spectrogram understanding amplitude and normalised frequency
조회 수: 8 (최근 30일)
이전 댓글 표시
Hi experts
I am trying to understand how the amplitude and frequency is expressed with the 'spectrogram' command in matlab. I have the following code:
Fs = 500;
t = 0:1/Fs:10-1/Fs;
x1 = 10*cos(2*pi*50*t);
x2 = cos(2*pi*60*t + 45*(pi/180));
x3 = cos(2*pi*70*t+ 10*(pi/180));
x = x1+x2+x3;
[s,f,t]=spectrogram(x)
am = abs(s);
tol = 280;
s(abs(s) < tol) = 0;
ph = angle(s);
figure
subplot(2,1,1)
plot(f,am(:,1))
subplot(2,1,2)
plot(f,ph(:,1)*(180/pi))
S gives me a complex matrix wich i can calculate the amplitude and phase with abs(S) and angle(S). When i plot the spectrum in amplitude-frequency domain for a certain time i get the following:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/344554/image.png)
- First of all i have 3 components on 50Hz, 60Hz and 70Hz. I alreay looked up what normalized frequency means and if im right the normalised frequency is /calculated as: f/fNyquist. So with a sample frequency of 500Hz the nyquist freq is 250Hz. Shouldnt this give 50/250=0.2, 60/250=0.24 and 70/250=0.28 as normalised frequency? instead i get 0.62, 0.75 and 0.88. What could be the problem here?
- My second question is how the amplitude is expressed? For x1 = 10*cos(2*pi*50*t); i get an amplitude of 2970 and for x2 = cos(2*pi*60*t + 45*(pi/180)); i get an amplitude of 295. What does this exactly mean? an amplitude of 1 in time domain corresponds with 300... in frequency domain.
- phase plot fft (strange)values here my problem with the phase was fixed but now i see a similar problem wich i dont quite know how to fix. When i use a normal fft i get the phases that i want.
Kind regards
댓글 수: 1
hosein Javan
2020년 8월 11일
if you are measuring a power signal, I say instead of using spectrogram, use fft. spectrogram uses window function. if you can estime your signal frequency, you can cut a piece of your signal and perform an fft analysis. it's very simple though.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Spectral Measurements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!