How to plot trend lines of 2 FFT graphs which have very large data points?

Dear Guys!!
I got the problem on plotting FFT graph by Matlab. I need to compare FFT of 2 signals in the same graph.
From the attached pictured, those two signals were sampled from 600kHz, 10 sec. When I plot them on graph, it look like the filled pattern which is very hard to compared. I need to plot by 2 trend lines (unfilled like example in the middle graph).
I have tried several days to find the way to plot them like the graph in the middle of picture.
Nae = length(ae);
fs1 = 600000; % sampling rate of signal
t = [0:Nae-1]/fs1;
ff = (0:Nae/2)*fs1/Nae;
AE = fft(ae); AE(1)= [];
power = abs(AE(1:length(ff))*2/Nae).^2;
AE2 = fft(ae2); AE2(1)= [];
power2 = abs(AE2(1:length(ff))*2/Nae).^2;
h = figure(2);
plot(ff,power,'b',ff,power2,'r');
legend('Signal 1','Signal 2');
Any suggestion ???
Thank you very much

1 件のコメント

Omar Alngar
Omar Alngar 2016 年 6 月 10 日
Hi do you find the solution for this it is my problem too

サインインしてコメントする。

回答 (1 件)

Youssef  Khmou
Youssef Khmou 2014 年 9 月 15 日
One temporary solution is to downsample the two power spectra, this proposition is based on time-frequency uncertainty principle, since the physical resolution will not improve unless you have more samples in time domain, so you can truncate elements :
f=20;
Power=power(1:f:end);
Power2=power2(1:f:end);
% try with different values of gap f, or use downsample(power,c) function .

3 件のコメント

Nopparat Seemuang
Nopparat Seemuang 2014 年 9 月 15 日
thanks so much, Youssef
I have tried to resample but the signal changes because lost some important data point resulting in lost of some frequency content. this should be avoid for my work.
Youssef  Khmou
Youssef Khmou 2014 年 9 月 15 日
can you use correlation function between the two signals? (xcorr(power,power2)) ?
Nopparat Seemuang
Nopparat Seemuang 2014 年 9 月 22 日
I have just tried. The graph looks like my need. How can I modify to meet my request of two fft compared in the same graph?
Thanks

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeFourier Analysis and Filtering についてさらに検索

タグ

質問済み:

2014 年 9 月 15 日

コメント済み:

2016 年 6 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by