Matlab script from q2 onwards.
Extracted text: 2.1 Spectrogram Frequency Resolution This part considers signals of the form: s(t) = cos(27 (f1)t) + cos(27(f2)t). Assume that f2 > f1. 1. Sketch S(f), the spectrum of the signal s(t). As discussed in class, the frequency resolution of the spectrogram is inversely proportional to length of the window. When the spectrum has two lines at fi and f2 Hz, these lines will be clearly visible in the spectrogram when Twin F2-fil' The duration of the window is related to the window length in samples via the sample frequency, i.e., Twin = nwin/fs. For all the parts below, assume that the sample frequency fs is 10,000 Hz. where C is a proportionality constant and Twin is the duration of the window in seconds. 2. Assume that fi = 500 Hz and f2 = 520 Hz. Generate 2 seconds of samples of the signal s(t). Compute the spectrogram using a window length of nwin=200. Make a plot. Zoom in and verify that two separate spectral lines are not visible in the plot. Note that there are several ways to zoom in on the plot: • Click on the zoom button at the top of the figure window. Select the part of the plot you want to highlight. • Use the axis command. This may not work reliably under all versions of MATLAB. • Use a command like set (gca,'YLim', [2 4]) to set the y-axis lower limit to 2 and upper limit to 4. You can use set (gca,'XLim' , [2 4]) to set the x-axis limits. These commands seem to work even when the axis command is unreliable. 3. Increase the window length until you can see two spectral lines in your spectrogram plot. Getting a window length value correct to the nearest 100 samples is sufficient. Based on this window length, estimate the proportionality constant C. 4. Now assume that fi = 2500 Hz and f2 = 2520 Hz. Use the value of C derived in the previous part to predict the window length you should use for this example. Compute the spectrogram. Can you see two lines in the spectrum? This should confirm that C depends only on the difference in the two frequencies (not the exact values associated with those frequencies). 5. Now assume that f1 = 500 Hz and f2 = 600 Hz. Use the value of C you derived to predict the window length you should use for this example. Can you see two lines in the spectrum? 6. Summarize what you learned about the segment length required to resolve two closely-spaced sinusoids based on the spectrogram.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here