필터 지우기
필터 지우기

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개)

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 CenterFile Exchange에서 Spectral Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by