필터 지우기
필터 지우기

Trouble understanding why the spectrum of my signal is at maximum power all frequencies

조회 수: 6 (최근 30일)
So I'm playing around with spectrograms and I'm trying to output a spectrogram where frequency actually changes with time so I've written this little bit of code:
fs = 250;
t = 0:1/fs:2;
temp = vco(sin(2*pi*t),5,fs);
temp1 = vco(sin(2*pi*t),5,fs);
temp2 = vco(sin(2*pi*t),5,fs);
temp3 = vco(sin(2*pi*t),40,fs);
temp4 = vco(sin(2*pi*t),45,fs);
temp5 = vco(sin(2*pi*t),90,fs);
temp6 = vco(sin(2*pi*t),90,fs);
x = [temp temp1 temp2 temp3 temp4 temp5 temp6];
segment_length = length(temp);
length(x);
winSize = segment_length;
fftSize = winSize;
overlap = floor(winSize/2);
[S,F,T,P] = spectrogram(x,winSize,overlap,fftSize,fs);
spectrogram(x,winSize,overlap,fftSize,fs)
The idea is that each 'temp' is a segment of the overall signal x. After three temps, the frequency continues to change and I'm hoping that I've used spectrogram correctly as I've used the length of each segment as the window and fftSize is equal to window length. However, my spectrogram output is this:
It seems that at 4 seconds it's at temp 2 which should only have power in the 40 - 80 Hz range whilst it does have that, it also seems to retain the frequencies of the first three segments and I'm not entirely sure why.
If I look at the Signal Analyzer App:
My x signal looks right to me as the frequency is changing as it should but I don't quite understand why I'm still having the same problem in the spectrogram, once it gets to 900-1000 samples the waveform changes representing a frequency of 40 Hz but for some reason in the spectrogram I'm still retaining all the information of the previous segment's frequency.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Time-Frequency Analysis에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by