Filter löschen
Filter löschen

Finding a 50 Hz Wave

1 Ansicht (letzte 30 Tage)
Derrick Joseph
Derrick Joseph am 12 Nov. 2019
Kommentiert: Derrick Joseph am 12 Nov. 2019
I have to plot the signal that supposedly contains 50 Hz sine waves. The question hinted that if you find the correlation, you'll be able to distinguish the peaks but I'm not getting accurate results this way. I asked a classmate and he told me that there are supposed to be 5 or 6 instances but I keep getting one. How do I fix this?
fs1 = 500;
N = length(x);
time_x = (0:N-1)/fs1;
[Rxx_2, lagsXX] = xcorr( x, 'coeff' );
[maxRxx_2, maxTxx] = max( Rxx_2 );
figure(7);
plot(time_x, x)
title("Problem 26 Signal")
xlabel("Time(s)")
ylabel("Signal")
figure(8);
plot( lagsXX/fs1 , Rxx_2 )
title("Autocorrelation - Problem 26")
  2 Kommentare
Image Analyst
Image Analyst am 12 Nov. 2019
You forgot to attach x. Your signal is probably the sum of 6 or 7 sine waves with different phases, so you should see spikes in the correlation corresponding to the phase. And the spikes should not be at multiples of each other (or else that's just the same phase moved over by a full cycle.)
Derrick Joseph
Derrick Joseph am 12 Nov. 2019
Where did I forget to attach x?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by