Complete the code to compute the spectrogram of signal x using window length 256.
spectrogram(x, [1], 128, 256, fs);
The window length parameter defines the size of each segment. Using 256 matches the desired window length.
Complete the code to set the overlap between segments to 75% of the window length.
window_length = 256; overlap = [1]; spectrogram(x, window_length, overlap, 512, fs);
75% of 256 is 192, so the overlap should be set to 192 samples.
Fix the error in the code to compute the spectrogram with a Hamming window.
window = [1](256); spectrogram(x, window, 128, 512, fs);
The Hamming window is created by the function hamming in MATLAB.
Fill both blanks to create a spectrogram with a Blackman window and 50% overlap.
window = [1](512); overlap = [2]; spectrogram(x, window, overlap, 1024, fs);
Blackman window is created by blackman(512). 50% overlap of 512 is 256.
Fill all three blanks to compute a spectrogram with a Hanning window, 75% overlap, and FFT length 1024.
window = [1](1024); overlap = [2]; fft_length = [3]; spectrogram(x, window, overlap, fft_length, fs);
Hanning window is created by hanning(1024). 75% overlap of 1024 is 768. FFT length is 1024.
