hello i don't want to use chirp inbuilt function and i have written a code for chirp. could any one tell me is the code is correct ? i have simulate it and getting plot but at instantaneous time t1, I am not getting frequency change.
i have written a code according to equation of chirp signal generation.
please tell me this is correct ?
*****************************************
f1 =10;
f2 = 50 ;
t =0:0.001:20;
t1 = 10;
alpha = (f2-f1)/t1;
f= (alpha)*t + f1;
xx =1*cos(f);
plot (t,xx);
**********************************************

댓글 수: 1

Neal Bambha
Neal Bambha 2019년 12월 16일
This is not the correct expression for a linear chirped signal. See the wikipedia page for "Chirp" There is a t-squared term in the sine. Otherwise you will not have the correct spectrum
chirp_slope = (f2 - f1)/t(end);
chirp_signal = sin(2*pi*(0.5*chirp_slope*t.^2 + f1*t));

댓글을 달려면 로그인하십시오.

 채택된 답변

Youssef  Khmou
Youssef Khmou 2013년 2월 5일
편집: Youssef Khmou 2013년 2월 5일

0 개 추천

hi, try this :
Fs=1000; % sample rate
tf=2; % 2 seconds
t=0:1/Fs:tf-1/Fs;
f1=100;
f2=400; % start @ 100 Hz, go up to 400Hz
semi_t=0:1/Fs:(tf/2-1/Fs);
sl=2*(f2-f1/2);
f1=f1*semi_t+(sl.*semi_t/2);
f2=f1(end)+f2*semi_t-sl.*semi_t/2;
f=[f1 f2];
y=1.33*cos(2*pi*f.*t);
plot(t,y)

댓글 수: 6

Aniket
Aniket 2013년 2월 7일
편집: Aniket 2013년 2월 7일
Hello Youssef, i have used your code and got some results. but i am not getting what is going in the following step
f1=f1*semi_t+(sl.*semi_t/2);
f2=f1(end)+f2*semi_t-sl.*semi_t/2;
could you please explain
hi, consider the slope as :
K=f2-f1/2 ;
then :
f1=f1*semi_t+(K*semi_t);
f2=f1(end)+f2*semi_t-(K*semi_t);
We added "f(end)" to have continuity in the frequency , to test do this :
f1=f1*semi_t+(K*semi_t);
f2=f2*semi_t-(K*semi_t);
f=[f1 f2]; plot(t,f)
vamsi
vamsi 2013년 8월 23일
hi youssef i execuded the code but the output is not comming for fs=500e6,f1=160e6 ,f2=170e6 ,t=5e-6 could u please explain that...
hi vamsi,
Your parameters do not fit the last example because of scaling problem; the frequency continues to increase or cant reach the final value f2 . To overcome this issue, consider the frequency as function F=at+constant that when time ends F=f2 and when time starts F=f1 :
Fs=500e6;
f=5e-6;
t=0:1/Fs:tf-1/Fs;
f1=160e6 ;
f2=170e6;
SLOPE=(f2-f1)./t(end);
F=f1+SLOPE*t;
y=1.33*cos(2*pi*F.*t);
plot(t,y)
fy=fft(y);
Freq=(0:length(t)-1)*Fs/length(t);
figure, plot(Freq(1:end/2),abs(fy(1:end/2)))
Have you ever used the function chirp(t,f0,t1,f1) ?
Atilla Golan
Atilla Golan 2018년 1월 21일
편집: Atilla Golan 2018년 1월 21일
Hi Youssef, Can we try up-going and down going chirp together? (without using chirp function on Matlab). In a time range of [1.2s 2.7s] (for example) my function should go up 0.6s (since 1.2s to 1.8s) and go down for the rest (since 1.8s to the end:2.7s). I mean in a constant frequency range, function goes up and down during time like quadratic chirp function but without using chirp.
Dhananjay Singh
Dhananjay Singh 2019년 2월 25일
hi youssef,
the code you last sent doesn't work when i set the values of f1, f2 in Khz. can you help?

댓글을 달려면 로그인하십시오.

추가 답변 (3개)

Honglei Chen
Honglei Chen 2013년 2월 5일

0 개 추천

It should be
cos(2*pi*f.*t)
instead of
cos(f)
REEM ALI
REEM ALI 2014년 1월 30일

0 개 추천

please i want to generate triangular modulation sweep of fmcw of rx and tx
farouk behar
farouk behar 2015년 8월 11일

0 개 추천

f = 150; a =5; w =2*pi*f; t =0:0.1:20; theta = pi/2; X = a*cos((w*t)+theta); y0 = X + 2*rand(size(t));
plot(t,y0)

태그

질문:

2013년 2월 5일

댓글:

2019년 12월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by