Main Content

Resolve Tones by Varying Window Leakage

You can adjust the spectral leakage of the analysis window to resolve sinusoids in Signal Analyzer.

Generate a two-channel signal sampled at 100 Hz for 2 seconds.

  1. The first channel consists of a 20 Hz tone and a 21 Hz tone. Both tones have unit amplitude.

  2. The second channel also has two tones. One tone has unit amplitude and a frequency of 20 Hz. The other tone has an amplitude of 1/100 and a frequency of 30 Hz.

fs = 100;
t = (0:1/fs:2-1/fs)';

x = sin(2*pi*[20 20].*t)+[1 1/100].*sin(2*pi*[21 30].*t);

Embed the signal in white noise. Specify a signal-to-noise ratio of 40 dB.

x = x + randn(size(x)).*std(x)/db2mag(40);

Open Signal Analyzer and plot the signal. On the Analyzer tab, with the signal selected in the Signal table, click Time Values and select Sample Rate and Start Time. Specify Sample Rate as fs Hz and Start Time as 0 s. On the Display tab, click Spectrum to add a spectral plot to the display.

Signal Analyzer app, showing the Display strips, from which the Time and Spectrum views are selected. The app also displays the signal "x" with channels 1 and 2, in time domain and frequency domain.

Click the Spectrum tab. The slider that controls the spectral leakage is in the middle position, corresponding to a resolution bandwidth of about 1.28 Hz. The two tones in the first channel are not resolved. The 30 Hz tone in the second channel is visible, despite being much weaker than the other one.

Increase the leakage so that the resolution bandwidth is approximately 0.83 Hz. The weak tone in the second channel is clearly resolved.

Signal Analyzer app, showing the Spectrum strip, from which Leakage is selected. The app also displays the signal "x" with channels 1 and 2, in time domain and frequency domain.

Move the slider to the maximum value. The resolution bandwidth is approximately 0.5 Hz. The two tones in the first channel are resolved. The weak tone in the second channel is masked by the large window sidelobes.

Click the Display tab. Use the horizontal zoom to magnify the frequency axis. Add two cursors to the display and drag the frequency-domain cursors to estimate the frequencies of the tones.

Signal Analyzer app, showing the Display strips, from which the Data Cursor toggle button is selected. The app also displays the signal "x" with channels 1 and 2. Two vertical data cursors are shown in the time-domain and frequency-domain plots.

See Also

Apps

Functions

Related Examples

More About