MATLAB Signal Processing 2 — Questions and Answers
Question 1: What does `ifft(X)` compute in MATLAB?
- The integer FFT of X
- The inverse discrete Fourier Transform of X (Correct answer)
- The imaginary part of the FFT of X
- The iterative approximation of the FFT of X
Correct answer: The inverse discrete Fourier Transform of X
`ifft(X)` computes the inverse discrete Fourier Transform, converting frequency-domain data back to the time domain.
Question 2: Which MATLAB function designs a Butterworth IIR filter given order n and normalized cutoff frequency Wn?
- fir1(n, Wn)
- butter(n, Wn) (Correct answer)
- freqz(n, Wn)
- filtfilt(n, Wn)
Correct answer: butter(n, Wn)
`butter(n, Wn)` returns the transfer function coefficients [b, a] of an nth-order Butterworth lowpass filter with cutoff Wn.
Question 3: What does the MATLAB `spectrogram(x, window, noverlap, nfft, fs)` function display?
- A static amplitude-versus-time plot
- The frequency spectrum at a single time instant
- A time-frequency representation showing how spectral content changes over time (Correct answer)
- Only the phase response of the signal
Correct answer: A time-frequency representation showing how spectral content changes over time
`spectrogram` computes and displays the short-time Fourier transform, showing how the frequency content of a signal varies with time.
Question 4: Which MATLAB function estimates the power spectral density of a signal using Welch's averaged periodogram method?
- fft(x)
- periodogram(x)
- pwelch(x) (Correct answer)
- spectrum(x)
Correct answer: pwelch(x)
`pwelch(x)` estimates the PSD by dividing the signal into overlapping segments, windowing each, computing FFTs, and averaging.
Question 5: What is the primary purpose of the MATLAB `resample(x, p, q)` function?
- To add white Gaussian noise to signal x
- To change the effective sampling rate of signal x by ratio p/q (Correct answer)
- To remove high-frequency components above cutoff q
- To compute the envelope of signal x
Correct answer: To change the effective sampling rate of signal x by ratio p/q
`resample(x, p, q)` resamples signal x at p/q times the original sample rate using a polyphase filter.
Question 6: Which MATLAB function finds local maxima (peaks) in a data vector and returns their values and locations?
- max(x)
- findpeaks(x) (Correct answer)
- localmax(x)
- peak(x)
Correct answer: findpeaks(x)
`findpeaks(x)` returns the values and indices of local maxima in vector x, with optional threshold and prominence filtering.
Question 7: The MATLAB `xcorr(x, y)` function computes:
- The cross-correlation sequence of signals x and y (Correct answer)
- The cross-convolution of x and y
- The auto-power spectrum of x
- The normalized inner product of x and y only at zero lag
Correct answer: The cross-correlation sequence of signals x and y
`xcorr(x, y)` returns the cross-correlation sequence estimating the similarity between x and y as a function of lag.
What does `ifft(X)` compute in MATLAB?