Modify signal and define natural frequency
4 次查看(过去 30 天)
显示 更早的评论

Hello everyone, I would like to define natural frequencies of the signals that I plotted (PSD and FFT). How is it possible to "modify" the plot in order to get more precise and clear peaks of the signals. It would be appreciated if you give me a piece of advice how to work out it. Thanks in advance!
signal1=a(:,1,1);
signal2=a(:,232,1);
Fs=32768;
subplot(211);
N=2048;
y1= fft(signal1,N)/length(signal1);
Fn = Fs/2;
Fv = linspace(0, 1, fix(length(y1)/2)+1)*Fn;
Iv = 1:length(Fv);
y2= fft(signal2,N)/length(signal2);
Fn = Fs/2;
Fv = linspace(0, 1, fix(length(y2)/2)+1)*Fn;
Iv = 1:length(Fv);
subplot(211)
plot(Fv,abs(y1(Iv))*2,'r');
hold on
plot(Fv,abs(y2(Iv))*2,'g');
title('Frequency Response-FFT')
xlabel('Frequency (Hz)')
ylabel('Magnitude')
%red signal
N1 = length(signal1);
xdft1 = fft(signal1);
xdft1 = xdft1(1:N1/2+1);
psdx1 = (1/(2*pi*N1)) * abs(xdft1).^2;
psdx1(2:end-1) = 2*psdx1(2:end-1);
freq1 = 0:(2*pi)/N1:pi;
%green signal
N2 = length(signal2);
xdft2 = fft(signal2);
xdft2 = xdft2(1:N1/2+1);
psdx2 = (1/(2*pi*N2)) * abs(xdft2).^2;
psdx2(2:end-1) = 2*psdx2(2:end-1);
freq2 = 0:(2*pi)/N2:pi;
subplot(212)
plot(freq1/pi,10*log10(psdx1),'r')
hold on
plot(freq2/pi,10*log10(psdx2),'g')
title('Periodogram Using FFT')
xlabel('Normalized Frequency (\times\pi rad/sample)')
ylabel('Power/Frequency (dB/rad/sample)')
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Parametric Spectral Estimation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!