I have bunch of signals.and I have another signal that is one of mentioned signals but with shifted and different magnitude. How can I find out which signal shifted signal with different magnitude?

4 vues (au cours des 30 derniers jours)
very simple example: my signals are: a=sin^2(x); b=cos^2(x)-2; c=x^3-1; d=x^2-1; and my another signal is f=4*cos^2(x-3);
How can I find out f looks like b ????
thank you very much.

Réponse acceptée

Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh le 19 Août 2014
Modifié(e) : Salaheddin Hosseinzadeh le 19 Août 2014
Hi Vahid,
Use
crosscorr(f,b)
or
crosscor(f,b,numel(b)-1)
read MATLAB documentation about crosscorr and how you've to interpret it's output
If you've an amplitude in the out put of crosscorr that is close to 1 it means f and b are similar, if amps are way below 1 then they ain't similar.
doc crosscor
Fs = 100; % Hz
t = 0:1/Fs:2*pi; %
f = 1; % Hz
x = sin(2*pi*f*t);
y = sin(2*pi*f*t + pi/2); % sine and cosine with frequency of 1
z = t.^2; %
crosscorr(x,y)
figure
crosscorr(x,z)
  2 commentaires
Andrew Reibold
Andrew Reibold le 19 Août 2014
Nice. This wasn't my question, but I learned something today.
vahid torabi
vahid torabi le 21 Août 2014
Thank you so much Mr Hosseinzadeh.But my signals are discrete.I have .mat data.I mean:(timeseries data) my signals have time and magnitude. signal 1 : have time(.mat file) and a value(.mat file) signal 2 :......... signal 3 :.......
How to code in this case????

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by