How to create a delayed version of a cosine signal?
25 ビュー (過去 30 日間)
古いコメントを表示
I have defined a cosine signal with 100 Hz frequency using the code:
st=1/1000; % sampling frequency Fs=1000;
t=[0:999]*st;
cos(2*pi*100*t);
I want to create a second cosine signal of the same frequency and length but with a time delay of 0.0050 seconds. I tried creating a separate vector and using that time vector to define the signal.
t1=[50:1049]*st;
cos(2*pi*100*t1)
But when I use the cross correlation function to verify the delay between the signals it shows that the delay is zero.
Please help me out here. Thank you
0 件のコメント
回答 (2 件)
Andrew Reibold
2014 年 7 月 24 日
Your second cosine function definitely IS shifting. Its just that you are shifting it over exactly 5 periods, so it lies on top of itself again.
I'm not sure which cross correlation function you are talking about, but perhaps it only only looks at delay between overlapping periods, in your case which may be 0. Does that make sense?
2 件のコメント
Andrew Reibold
2014 年 7 月 24 日
PS. You can verify it is shifting visually with a simple plot :)
figure;
plot(t,cos(2*pi*100*t),t1,cos(2*pi*100*t));
参考
カテゴリ
Help Center および File Exchange で Spectral Measurements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!