How can plot the following signal?

1 回表示 (過去 30 日間)
mskumarsajeesh mskumar
mskumarsajeesh mskumar 2012 年 8 月 12 日
I have a sine wave like this 230*sin(2*pi*50*t) this signal is persisted for 0.04 seconds,and at 0.04 second the signal's frequency started to change(only frequency, no change in magnitude), it's not step change, it's changing slowly as the time passes,from 50Hz to 50.1 Hz(50.01,50.05,50.10.... 50.79..50.1 like this or similar). At 0.08 sec the frequency reached at 50.1 Hz and the signal continued with this frequency till 0.12 sec with 50.1 Hz.At 0.12 sec the frequency started to decrease from 50.1 Hz to 50 Hz slowly as mentioned above from sec and settled at 50 Hz at 0.16 sec.And continued with this 50 Hz frequency till 0.20 sec.I am getting an error while trying to plot.How can i program and plot this signal? can any one help in this?

採用された回答

Wayne King
Wayne King 2012 年 8 月 12 日
Then, you just make the adjustments:
t = 0:0.0001:0.20;
sig = zeros(size(t));
x1 = 230*sin(2*pi*50*t(1:400));
x2 = 230*(chirp(t(401:800),50,0.08,50.1,'linear',-92));
x3 = 230*sin(2*pi*50.1*t(801:1200));
x4 = 230*(chirp(t(1201:1600),50.1,0.16,50,'linear',-90));
x5 = 230*sin(2*pi*50*t(1601:end));
sig = cat(2,x1,x2,x3,x4,x5);
You'll want to look at the values of x1(end) and x2(1) x3(end) x4(1) etc to adjust the starting phase of the chirp if necessary.
  1 件のコメント
mskumarsajeesh mskumar
mskumarsajeesh mskumar 2012 年 8 月 12 日
Thanks wayne.Its worked...

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

その他の回答 (1 件)

Wayne King
Wayne King 2012 年 8 月 12 日
I think you need to define the signal piecewise. Something like:
t = 0:0.001:0.20;
sig = zeros(size(t));
x1 = 230*cos(2*pi*50*t(1:40));
x2 = 230*(chirp(t(41:80),50,0.08,50.1));
x3 = 230*cos(2*pi*50.1*t(81:120));
x4 = 230*(chirp(t(121:160),50.1,0.16,50));
x5 = 230*cos(2*pi*50*t(161:end));
sig = cat(2,x1,x2,x3,x4,x5);
plot(t,sig)
You may have to use the optional input argument, phi, in chirp() to make sure you don't have any jumps where the linear chirp sections begin and end.
  3 件のコメント
Wayne King
Wayne King 2012 年 8 月 12 日
I'm not sure what you're talking about. What is the difference between a cosine and sine, just phase. And the chirp() is giving you the linear increase in the sine wave frequency that you asked for.
mskumarsajeesh mskumar
mskumarsajeesh mskumar 2012 年 8 月 12 日
No difference wayne but i need a sinusoidal signal which is to be zero at t=0 and t=0.02 sec (50Hz).That's what i said i am so particular about 230.sin.could u now give an answer?

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

カテゴリ

Help Center および File ExchangeParametric Spectral Estimation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by