MATLAB - Delay sine wave

14 ビュー (過去 30 日間)
long le
long le 2020 年 11 月 8 日
コメント済み: Alan Stevens 2020 年 11 月 8 日
I have a damped sine wave as below:
N=250;
Fs=20;
Ts=1/Fs;
t=(0:N-1)*Ts;
A = 3;
f = 1;
x = A*exp(-t).*sin(2*pi*f*t);
How can I generate a delay signal from the damped sine wave x, so that:
y(n) = a*x(n-k)+b(n),
Where a is the attenuation coefficient, b(n) is the noise and k is a delay

回答 (1 件)

Alan Stevens
Alan Stevens 2020 年 11 月 8 日
Like this?
N=250;
Fs=20;
Ts=1/Fs;
t=(0:N-1)*Ts;
A = 3;
f = 1;
signal = @(t) A*exp(-t).*sin(2*pi*f*t);
x = signal(t);
a = 0.7; % attenuation coefficient
k = 10*Ts; % delay time
b = 0.1*randn(1,numel(t)); % normally distributed noise
y = a*signal(t-k) + b;
plot(t,x,t,y),grid
xlabel('t'),ylabel('signal')
legend('signal','delayed signal')
  2 件のコメント
long le
long le 2020 年 11 月 8 日
編集済み: long le 2020 年 11 月 8 日
Thank you.
But I think that the length/time of the emitted signal should be shorter than the received one because of the delay?
The received signal should be longer
Alan Stevens
Alan Stevens 2020 年 11 月 8 日
I wouldn't know! But doesn't it just mean you define a different timespan for the delayed signal?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSpectral Measurements についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by