Regarding logarithmic chirp signal

how to generate logarithmic chirp signal without inbuilt function in matlab
In matlab there is an inbuilt command to generate logarithmic chirp signal using
chirp(t,f0,t1,f1,'method') by simply replacing the method with 'lo', we will get the logarithmic chirp signal. i would like to know the basic mathermatical equation to generate the logarithmic chirp signal.
Thanks in advance.

Answers (1)

hi
simple demo below :
% log sweep demo
f1 = 50; % start freq
f2 = 200; % stop freq
Fs = 1e3; % sampling frequency
duration = 30; % s
%%%%%%%%%%%
dt = 1/Fs;
samples = floor(duration*Fs)+1;
t = (0:dt:(samples-1)*dt);
log10_freq = linspace(log10(f1),log10(f2),samples);
freq = 10.^log10_freq;
omega = 2*pi*freq;
angle_increment = omega.*dt;
angle = cumtrapz(angle_increment); % angle is the time integral of omega.
signal = sin(angle);
figure(1);
plot(t,signal)
%%%%%%%%%%%
% spectrogram demo
NFFT = 512; % to have highest frequency resolution , NFFT should be greater than typical max length of files ( 1 second duration at Fs = 16 kHz = 1600 samples);
overlap = 0.75;
w = hamming(NFFT);
fmin = 1;
fmax = Fs/2.56;
[sg,fsg,tsg] = specgram(signal,NFFT,Fs,hamming(NFFT),overlap*NFFT);
% plots sg
figure(2);
imagesc(tsg,fsg,20*log10(abs(sg)));axis('xy');colorbar('vert');
title(['Spectrogram / Fs = ' num2str(Fs) ' Hz / Delta f = ' num2str(fsg(2)-fsg(1)) ' Hz ']);
xlabel('Time (s)');ylabel('Frequency (Hz)');

6 Comments

Dear
Mathieu NOE
Thank you for your reply,
i found the formulae for log chirp is like this
but i found the signal obtained by executing
chirp(t,f0,t1,f1,'lo')
and
signal obtained by using the following mathematical equation are different
and i also tried your code also there is a minute delay in the signal. please give me the exact mathematical description of logchirp signal for f0=0.01, f1=0.1 and t1=100 and t=0.04:0.04:100
Thanking you
https://github.com/scipy/scipy/issues/1632
Dear Walter Roberson
Thank you for the response,
but i didn't get any solution with this. i need a mathematical expression to generate logarithmic chirp signal same as like
a=chirp(t,f0,t1,f1,'lo',-90);
in terms of
a1=sin(2*pi*f*t);
i need the formula for f
so that both plots figure,plot(t,a,t,a1) should be same.
The discussion there shows the formula several times. It also discusses why the formula is not a good thing especially at 0.
The formula shown there doesn't replicate the chirp signal obtained by default inbuilt function. That's why I am asking about exact mathematical formula to generate the chirp same as like inbuilt function
hello
there are many publications on chirp signal formulato be found on the internet
I admit I didn't even look at it before I generate my demo code , as it was quite obvious for me.
Now I also don't understand what you are exactly looking for ? The formula are quite simple to code even if the built in function do it in it own way. As usual, there can be multiple ways to code one function;

Sign in to comment.

Categories

Find more on Signal Processing Toolbox in Help Center and File Exchange

Asked:

$
$
on 23 Oct 2020

Commented:

on 26 Oct 2020

Community Treasure Hunt

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

Start Hunting!