Chirp (Swept-frequency cosine) Signal Generation

6 ビュー (過去 30 日間)
enrique128
enrique128 2021 年 3 月 14 日
コメント済み: Star Strider 2021 年 3 月 14 日
Hello everyone,
I am trying to generate the chirp signal which can be also named as Swept-frequency cosine. My signal's frequency should increase with respect to triangular signal as you can see. The problem is that, I did the increasing part but I could not integrate the decreasing part to the increasing part. It should be continuous, vary with the triangular signal and this signal must be one piece. My code is written below. Thanks for your helps...
t = 0:1/10000:2;
y = chirp(t,0,1,25);
plot (t,y);
hold on
T = 10*(1/50);
fs = 10000;
t = 0:1/fs:4;
x = sawtooth(2*pi*0.25*t,1/2);
plot(t,x, 'green', 'linewidth', 3);
grid on
Expected Signal Waveform:
My signal:

採用された回答

Star Strider
Star Strider 2021 年 3 月 14 日
Change the first plot call to:
plot (t,y, t(end)+t,fliplr(y));
If I understand correctly, that should do what you want.
  10 件のコメント
enrique128
enrique128 2021 年 3 月 14 日
編集済み: enrique128 2021 年 3 月 14 日
Sir all I want to do is make this signal periodic. It says
Error using plot
Vectors must be the same length.
Error in Untitled2 (line 9)
plot (tv,y, t(end)+t,fliplr(y));
Star Strider
Star Strider 2021 年 3 月 14 日
I was thinking of something like this:
tv = t;
yv = [y fliplr(y(1:end-1))];
figure
plot(tv, yv)
yve = repmat(yv, 1, 3);
tve = linspace(0, numel(yve), numel(yve))/fs;
figure
plot(tve, yve)
grid
xlim([min(tve) max(tve)])
I only extended it to 3 times its original length here.
Experiment with it to get the result you want.

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by