フィルターのクリア

Comparing fft of wavefiles

1 回表示 (過去 30 日間)
Anurag Pujari
Anurag Pujari 2013 年 2 月 16 日
I have to compare fft's of two wave files.What are the procedures to do so?Is there any predefined function for finding euclidean distance between two vectors in MATLAB?

回答 (1 件)

Wayne King
Wayne King 2013 年 2 月 16 日
yes, there are, but what are you trying to achieve. Do you know about coherence? Coherence is a frequency-domain measure of correlation. The values are between 0 and 1 (as opposed to [-1, 1] for the "usual" correlation). If you have the Signal Processing Toolbox, mscohere() computes the magnitude-squared coherence.
t = 0:0.001:1-0.001;
x = cos(2*pi*100*t)+0.5*cos(2*pi*200*t-pi/4)+randn(size(t));
y = 0.8*sin(2*pi*100*t)+0.75*sin(2*pi*200*t-pi/8)+randn(size(t));
[Cxy,F] = mscohere(x,y,200,100,200,1000);
plot(F,Cxy)
The above plot clearly shows that both x and y have coherent frequency content at 100 and 200 Hz.

カテゴリ

Help Center および File ExchangeCorrelation and Convolution についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by