Finding a 50 Hz Wave

1 次查看(过去 30 天)
Derrick Joseph
Derrick Joseph 2019-11-12
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 个评论
Image Analyst
Image Analyst 2019-11-12
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 2019-11-12
Where did I forget to attach x?

请先登录,再进行评论。

回答(0 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by