MATLAB >> chirp function

by Tim Teatro » Mon, 26 Apr 2004 18:07:38 GMT

Hi. I'm realy sorry to ask this, but do I have to load something before I
can use the chirp function? I can't seem to find an m-file for it in the
matlab directory.


MATLAB >> chirp function

by loren.shure » Mon, 26 Apr 2004 19:45:08 GMT


chirp.m is a function in the Signal Processing Toolbox. Perhaps you don't have
that on your path.


MATLAB >> Chirp Function

by Dali » Tue, 27 Sep 2005 18:04:33 GMT

Hi everybody.

Currently, I'm writing a program using the built-in chirp function.
The duration of my chirp is very short: between 0.4 to 1 microsecond.

When the frequency range of my chirp is between 0 and 10 MHz, my
Chirp is okay and its autocorrelation function gives a sinc function
as the theory says.
But when I change the frequency range between 10 to 20 MHz, then the
sinc is completely degraded. In fact, the amplitude of its side lobes
increase a lot.
I don't think it's a problem of aliasing because my sampling
frequency is very high.
So I don't understand this problem because according to the theory,
the shape of the sinc depends of the bandwidth and not the starting
Is there anyone who knows the answer to my problem?

Thanks a lot

MATLAB >> Chirp Function

by Jordan Smith » Thu, 01 Jun 2006 12:00:41 GMT

I want to make a chirp function that varies the frequency on time. I
have tried to use the chirp function but I want to make the chirp
function to do the following:

Have slight noise / begining of the function... increase the
amplitude continue to vary the frequency based on the time. Finally
decrease the amp. at the end of the time desired. I have something
like this; however, it just makes a single jump.

I am not sure what else to do... Sort of new at this whole MATLAB
See below two methods:

Here is one method I've tried:
% inputs--
% TW: Time bandwidth product
% p: oversampling factor
% sampfreq: sampling frequency to be used

%s: Single LFM chirp created per input specs
%h: The match filter impulse response (i.e. h(t))
% The result of passing created chirp through
% match filter
%T: Time duration of LFM chirp (units: sec)
%W: Swept Bandwidth of LFM chirp (units: Hz)
%Ts: Sampling period (1/fs)

Ts = 1/ (sampfreq) %1/(20*(10 ^6)) % 1 / (p*W)

T = TW * p *Ts

W = TW / T

N = round( T/Ts); % round(T*W*p)
n = [0:N-1]';

s = exp(j*pi* (W/T) *(n*Ts - T/2).^2 );
h = exp(-j*pi* (W/T) *(n*Ts - T/2).^2 );

y = conv(s,h);

for n = 1:length(sig2) %create 700 point signal with chirp
column = 253+n; % chirp in the middle
blank2(1,446:700) = 0;

for n = 1:length(h)
column = 253+n;
h2(1,446:700) = 0;
n = (.2) .* crandn(1,700) ;
clear blank2noise
y = conv(blank2noise,h);
figure, plot(real(y));

Method 2:
just trying to use the chirp and trying to sum two different chirps
one from going dc to say 100hz and then from 100hz to 0 again.

MATLAB >> Chirp Function

by Jordan Smith » Fri, 02 Jun 2006 00:56:54 GMT

I want to create a chirp function that looks like the following

time varying harmonic /w amplitude at near zero going to X amount and
then decreasing back to 0.

Any suggestions?

MATLAB >> Chirp Function

by Jordan » Fri, 02 Jun 2006 01:32:30 GMT

Actually sorry about this.

What I ment to really ask was this:

I am trying to make an LFM chirp however everytime i make one I get a
weird fourier transform. I am trying to get it so that it looks like
<> ;

I am using the following code. Anyone suggestions?


Ts = 1/ (sampfreq) %1/(20*(10 ^6)) % 1 / (p*W)

T = TW * p *Ts

W = TW / T

N = round( T/Ts); % round(T*W*p)
n = [0:N-1]';

s = exp(j*pi* (W/T) *(n*Ts - T/2).^2 );
h = exp(-j*pi* (W/T) *(n*Ts - T/2).^2 );

y = conv(s,h);

for n = 1:length(sig2) %create 700 point signal with chirp
column = 253+n; % chirp in the middle
blank2(1,446:700) = 0;

clear blank2noise
% figure, plot(real(blank2noise))
y = conv(blank2noise,h);
figure, plot(real(y))

Similar Threads

1. chirp function (for dummies) - MATLAB

2. transfer function estimation for 1/s^2 using fft and chirp input signal


I am trying to estimate the transfer function as a form k*1/s^2 using chirp signal(0.1Hz - 100Hz at the sampling time of 0.0025s). But two bode plots of the transfer functions, one from the true transfer function, the other from fft calculation, are not matching.

I made a simulink model with a chirp block as an input, a transfer function block of 1/s^2, and two 'To Workspace block' to save the input, output data.
After running the simulation of my model, I run my fft m-file to do fft, calculate the estimated transfer function as fft(output)./fft(input), and plot the bode diagram. Then I expected the bode plot of the result from fft would match the bode plot of true 1/s^2, but they are not matching at all. The bode plot from fft calculation looks to have -10 db slope instead of -20 db slope and have higher magnitude than the true one.
However, if I try to estimate 1/(s^2 + 0.25s + 1), both bode plots from fft and the true transfer function are exactly matching.

I wonder what is making the difference between two bode plots for 1/s^2. Is there anyone who had this kind of problem? I appreciate your help in advance.


3. matlab code for Chirp waveform (frequency modulated pulse)

4. FFT Chirp Problems MATLAB

I am doing an FFT of a chirp function.

I am having problems with realizing the FFT! The FFT should when p =1 loo
like the signal in. It doesn't Any suggestions?! Thanks...

The following is the m-code:

function s = dtFMchirp(p,TW)

% DCHIRP generate a sampled chirp signal
% usage s = dchirp(TW,p)
% s : samples of a digital "chirp" signal 
% 	exp(j(W/T)pi*t^2)  -T/2 <= t < T/2
% TW : time-bandwidth product
% p : sample at p times the Nyquist rate (W)
%N = p*TW;
%n = 0:N;
%alpha = 1/(2*p*p*TW);
%s = exp(j*2*pi*alpha*((n-.5*N).^2));
close all;
N = p*TW;
n = 0:N;
alpha = 1/(2*p*p*TW);
s = exp(j*2*pi*alpha*((n-.5*N).^2));

fftx=[fftx(k:end) fftx(1:k)];

5. DFT of linear FM chirp and CW burst - MATLAB

6. Inverse chirp z transform

Dear All,

Could someone tell me how to implement INVERSE chirp z transform in
Matlab. Matlab has chirp z transform in signal processing toolbox but
no inverse - I read somewhere that it is possible to obtain inverse
chirp z transform by using chirp z transform. How to do it? Maybe
somebody would be willing to shed some light.



7. how to simulate LFM Chirp signal using MATLAB? - MATLAB

8. Linear chirp wigner plot, wrong mesh plot

I have a problem with using the Wigner function and
representing a linear chirp signal in the time-frequency domain.
When I use my algorithm and the  fft function the mesh plot
shows a signal whose frequency is decreasing with time
whereas the signal clearly represents a signal whose
frequency is increasing linearly with time.

I believe that the autocorrelation function is correct but I
am not getting the right graph and suspect that the fft
command is not performing correctly.

Grateful for any hints!!!!!!!!!!!!!!!!!!!

fs = 500;                           % Sample frequency
N = 512;                            % Signal length
f1 = 20;                            % Starting frequency in Hz
f2 = 200;                           % Frequency after 1
second (end) in Hz

T=(1/fs);                           % Sample Period
                                    % Construct “chirp” signal
t = (1:N)/fs;
s = chirp(t,f1,1,f2);               % Chirp based on array t 
                                    % Wigner-Ville analysis

figure ;
xlabel('Point');                    % Axis labels

soundsc(s,fs);                      % Play signal

s = hilbert(s);                     % Get analytic function
to remove problems with cross products 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Converts input signal
to Column Vector if not already so

[N,scol] = size(s);       % N,scol represents number of rows
and cols respectively
if N < scol               % Make signal column vector
s = s';                   % Standard (non-complex) transpose
N = scol;                 

R = zeros(N,N);         % Initialize output
t = (1:N)/fs;            % Calculate time vector
f = (1:N)*fs/(2*N);      % Calculate frequency vector    

for k = 1:N;
lagmax = min ([k-1,N-k,round(N/2)-1]);             
lag = -lagmax:lagmax;                              
R(lag + round(N/2),k) = s(k+lag).*conj(s(k-lag));   

R = circshift(R,round(N/2)+1 -mod(N,2));           
WD = 2*T*real(fft(R));                             % Returns
the discrete fourier tranform of WD

mesh(t,f,WD); % Mesh Plot
hold on;
xlabel('Time');              % Axis labels