Effacer les filtres
Effacer les filtres

How to write a cross signal function and apply it to the signals?

1 vue (au cours des 30 derniers jours)
Kennard Ng
Kennard Ng le 12 Fév 2019
Modifié(e) : Kennard Ng le 12 Fév 2019
xDataA = linspace(0,4*pi,1024); % create signal
yDataA = cos(xDataA); % array A
xDataB = linspace(0,4*pi,1024); % create signal
yDataB = sin(xDataB); % array B
p = yDataA.*yDataB ; % product of array A and B
r = xcorr(yDataA,yDataB);
plot (r);
Is this how it is done?

Réponses (1)

Star Strider
Star Strider le 12 Fév 2019
This looks like homework.
See the documentation on the xcorr (link) function. That will either solve your problem or get you started on writing your own function.

Community Treasure Hunt

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

Start Hunting!

Translated by