Generati a Complex LFM Chirp Waveformng A complex, continuous-time LFM chirp wav
ID: 3856850 • Letter: G
Question
Generati a Complex LFM Chirp Waveformng
A complex, continuous-time LFM chirp waveform that sweeps from –b/2 Hz to + b/2 Hz over a duration of t seconds is given by
Note that this is just the modulation function; an actual transmitted waveform would include an RF carrier term as well. The instantaneous frequency of a waveform is defined by
where theta(t) is the phase function, in this case ((pi*b)/t)t2. Inserting this phase function into Eqn. gives
which sweeps linearly from – b/2 Hz to + b/2 Hz as t runs from –t/2 to +t/2, as desired. The time-bandwidth product or “BT product” of the chirp is simply the product of its swept bandwidth and pulse length, bt. Equation 1 is called an “up chirp” because the instantaneous frequency increases during the pulse. A “down chirp” would be obtained by simply conjugating the phase of Eqn.1.
A discrete time equivalent can be defined by sampling x(t) at some interval Ts. Since the swept instantaneous bandwidth is b Hz, we might expect that the actual two-sided bandwidth is about b Hz (we will see that this depends on the BT product). We will therefore assume the sampling rate should be at least b samples/sec. It is often convenient to oversample the chirp to get better graphical results. We allow for this by including an oversampling factor k that will range from 1.2 to 10.0. Thus, the sampling interval becomes 1/kB samples/sec. The number of samples in the pulse is then t/Ts = k bt, or k times the BT product. Sampling Eqn 1. at this rate gives us the discrete-time LFM chirp
This is the expression we want to work with. A listing of a MATLAB function my_chirp.m that implements Eqn 4. is included at the end of this document.
MATLAB has a built in function chirp that can also be used to generate the waveform of Eqn.4. chirp generates real, rather than complex, chirp functions. However, by using two calls and changing the starting phase by 90º you can generate the real and imaginary parts of the complex chirp, then combine them to produce the final result. It is probably easier to use my_chirp.m.
my_chirp.m
function x = my_chirp( T, W, p )
%CHIRP generate a sampled chirp signal
% X = my_chirp( T, W, <P> )
% X: N=pTW samples of a "chirp" signal
% exp(j(W/T)pi*t^2) -T/2 <= t < +T/2
% T: time duration from -T/2 to +T/2
% W: swept bandwidth from -W/2 to +W/2
% optional:
% P: samples at P times the Nyquist rate (W)
% i.e., sampling interval is 1/(PW)
% default is P = 1
%
if nargin < 3
p = 1;
end
J = sqrt(-1);
%--------------
delta_t = 1/(p*W);
N = round( p*T*W ); %--same as T/delta_t
nn = [0:N-1]';
x = exp( J*pi*W/T * (delta_t*nn - (N-1)/2/p/W).^2 ); % symmetric version
1. Generate an LFM complex chirp with duration t = 100 ms and swept bandwidth b = 1 MHz. Oversample by a factor of at least k = 5 and preferably k = 10. Your pulse should have a length of kbt = 100k samples. Also generate a simple pulse of the same length; this would be simply a vector of kbt ones, which is easily generated with MATLAB’s ones function. What is the approximate bandwidth, in Hz, of the simple pulse?
2. Compute the output of the matched filter for each of the two pulses, assuming a single point scatterer. This will simply be the convolution of the waveform with its matched filter, or equivalently, the autocorrelation of the waveform. The computation must be done in the time domain. Overlay plots of the magnitude[1] of the two matched filter output responses onto the same plot. The time axis of the plot must be labeled in seconds, not samples.
[1] The matched filter output for the complex-valued chirp waveform will be complex-valued also, although the value at the peak should be purely real.
3. Compare the two responses. The derivation of the matched filter showed that the peak signal component at the output equaled the signal energy, regardless of the detailed shape of the signal. That is, any two signals with the same energy should produce the same peak magnitude at the output of their respective matched filters. Do these two waveforms have the same energy? Do their respective matched filter outputs have the same peak value? Does it equal the signal energy?
4. The first null of the Fourier transform of a rectangular pulse of length a (which is a sinc function) is expected to occur at 1/a in the complementary Fourier domain. Thus a time-domain simple pulse of length t seconds has a sinc Fourier transform with a first zero at 1/t Hz (Rayleigh resolution in frequency), while a rectangular spectrum of width b Hz has a sinc function with a first zero at 1/ b seconds in the time domain as its inverse Fourier transform (Rayleigh resolution in time).[1] We also know that the 3 dB bandwidth of the sinc will be 0.89/a and the 4 dB bandwidth 1/a; thus the peak-to-null bandwidth is a good estimate of the 3- or 4-dB width of the sinc pulse, and it is easier to measure. Continuing with the comparison of the LFM and rectangular pulses, what is the peak-to-first null width (in seconds) of the mainlobe response of the simple pulse? Of the LFM chirp? Is this consistent with their respective bandwidths? You may find that you get much better results if you computed the results above with a high oversampling factor. A factor of at least 5 is required; 10 is better. The higher oversampling factor will give you much more detail in the mainlobe and help you avoid being misled about the first zero location due to a sparsely-sampled filter output, but will generate longer signal vectors and take longer to run. However, for most current computers, run time should not be much of an issue.
[1] We also know that matched filter response to an LFM waveform is not exactly a sinc, due to the (1-|t|)/(T) terms that appear in the expression for the zero-Doppler cut of the ambiguity function (see Eqn. (4.99) in the text); but if the time-bandwidth product bt is reasonably large, as it is here, the first zero will be very close to 1/b.
Explanation / Answer
fs = 10000;
t = 0:1/fs:1.5;
x1 = sawtooth(2*pi*50*t);
x2 = square(2*pi*50*t);
subplot(2,1,1)
plot(t,x1)
axis([0 0.2 -1.2 1.2])
xlabel('Time (sec)')
ylabel('Amplitude')
title('Sawtooth Periodic Wave')
subplot(2,1,2)
plot(t,x2)
axis([0 0.2 -1.2 1.2])
xlabel('Time (sec)')
ylabel('Amplitude')
title('Square Periodic Wave')
fs = 10000;
t = -1:1/fs:1;
x1 = tripuls(t,20e-3);
x2 = rectpuls(t,20e-3);
subplot(2,1,1)
plot(t,x1)
axis([-0.1 0.1 -0.2 1.2])
xlabel('Time (sec)')
ylabel('Amplitude')
title('Triangular Aperiodic Pulse')
subplot(2,1,2)
plot(t,x2)
axis([-0.1 0.1 -0.2 1.2])
xlabel('Time (sec)')
ylabel('Amplitude')
title('Rectangular Aperiodic Pulse')
tc = gauspuls('cutoff',50e3,0.6,[],-40);
t1 = -tc : 1e-6 : tc;
y1 = gauspuls(t1,50e3,0.6);
t2 = linspace(-5,5);
y2 = sinc(t2);
subplot(2,1,1)
plot(t1*1e3,y1)
xlabel('Time (ms)')
ylabel('Amplitude')
title('Gaussian Pulse')
subplot(2,1,2)
plot(t2,y2)
xlabel('Time (sec)')
ylabel('Amplitude')
title('Sinc Function')
t = 0:0.001:2; % 2 secs @ 1kHz sample rate
ylin = chirp(t,0,1,150); % Start @ DC, cross 150Hz at t=1sec
Generate a quadratic chirp:
t = -2:0.001:2; % +/-2 secs @ 1kHz sample rate
yq = chirp(t,100,1,200,'q'); % Start @ 100Hz, cross 200Hz at t=1sec
subplot(2,1,1)
spectrogram(ylin,256,250,256,1E3,'yaxis')
title('Linear Chirp')
subplot(2,1,2)
spectrogram(yq,128,120,128,1E3,'yaxis')
title('Quadratic Chirp')
t = -1:0.001:1; % +/-1 second @ 1kHz sample rate
fo = 100;
f1 = 400; % Start at 100Hz, go up to 400Hz
ycx = chirp(t,fo,1,f1,'q',[],'convex');
t = -1:0.001:1; % +/-1 second @ 1kHz sample rate
fo = 400;
f1 = 100; % Start at 400Hz, go down to 100Hz
ycv = chirp(t,fo,1,f1,'q',[],'concave');
subplot(2,1,1)
spectrogram(ycx,256,255,128,1000,'yaxis')
title('Convex Chirp')
subplot(2,1,2)
spectrogram(ycv,256,255,128,1000,'yaxis')
title('Concave Chirp')
fs = 10000;
t = 0:1/fs:2;
x1 = vco(sawtooth(2*pi*t,0.75),[0.1 0.4]*fs,fs);
x2 = vco(square(2*pi*t),[0.1 0.4]*fs,fs);
subplot(2,1,1)
spectrogram(x1,kaiser(256,5),220,512,fs,'yaxis')
title('VCO Triangle')
subplot(2,1,2)
spectrogram(x2,256,255,256,fs,'yaxis')
title('VCO Rectangle')
fs = 100E9; % sample freq
D = [2.5 10 17.5]' * 1e-9; % pulse delay times
t = 0 : 1/fs : 2500/fs; % signal evaluation time
w = 1e-9; % width of each pulse
yp = pulstran(t,D,@rectpuls,w);
T = 0 : 1/50e3 : 10e-3;
D = [0 : 1/1e3 : 10e-3 ; 0.8.^(0:10)]';
Y = pulstran(T,D,@gauspuls,10E3,.5);
subplot(2,1,1)
plot(t*1e9,yp);
axis([0 25 -0.2 1.2])
xlabel('Time (ns)')
ylabel('Amplitude')
title('Rectangular Train')
subplot(2,1,2)
plot(T*1e3,Y)
xlabel('Time (ms)')
ylabel('Amplitude')
title('Gaussian Pulse Train')
hchirp = dsp.Chirp( ...
'InitialFrequency', 0,...
'TargetFrequency', 10, ...
'TargetTime', 10, ...
'SweepTime', 100, ...
'SampleRate', 50, ...
'SamplesPerFrame', 500);
chirpData = (step(hchirp))';
evenFlag = mod(minute(datetime('now')),2);
if evenFlag
chirpData = fliplr(chirpData);
end
waveform = phased.LinearFMWaveform('SampleRate',1e6,...
'PulseWidth',50e-6,'PRF',10e3,...
'SweepBandwidth',100e3,'SweepDirection','Up',...
'Envelope','Rectangular',...
'OutputFormat','Pulses','NumPulses',1);
waveform = phased.LinearFMWaveform('PulseWidth',100e-6,...
'SweepBandwidth',200e3,'PRF',4e3);
y = waveform();
t = unigrid(0,1/waveform.SampleRate,1/waveform.PRF,'[)');
figure
subplot(2,1,1)
plot(t,real(y))
axis tight
title('Real Part')
subplot(2,1,2)
plot(t,imag(y))
xlabel('Time (s)')
title('Imaginary Part')
axis tight
waveform = phased.LinearFMWaveform('PulseWidth',100e-6,...
'SweepBandwidth',2e5,'PRF',1e3);
[afmag_lfm,delay_lfm,doppler_lfm] = ambgfun(wav,...
waveform.SampleRate,waveform.PRF);
surf(delay_lfm*1e6,doppler_lfm/1e3,afmag_lfm,...
'LineStyle','none')
axis tight
grid on
view([140,35])
colorbar
xlabel('Delay au (mus)')
ylabel('Doppler f_d (kHz)')
title('Linear FM Pulse Waveform Ambiguity Function')
[ambrect,delay] = ambgfun(xrect,rectwaveform.SampleRate,rectwaveform.PRF,...
'Cut','Doppler');
ambfm = ambgfun(xlfm,lfmwaveform.SampleRate,lfmwaveform.PRF,...
'Cut','Doppler');
Plot the ambiguity function magnitudes.
subplot(211)
stem(delay,ambrect)
title('Autocorrelation of Rectangular Pulse')
axis([-5e-5 5e-5 0 1])
set(gca,'XTick',1e-5*(-5:5))
subplot(212)
stem(delay,ambfm)
xlabel('Delay (seconds)')
title('Autocorrelation of Linear FM Pulse')
axis([-5e-5 5e-5 0 1])
set(gca,'XTick',1e-5*(-5:5))
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)
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)))
sampleRate = 1e8; % Define sample rate of baseband signal (Hz)
pulseWidth = 10e-6; % Define pulse width (seconds)
pulseRepititionInterval = 50e-6;% Define pulse repetition interval (seconds)
bandWidth = 10e6; % Bandwidth of the pulse (Hz)
IPhase = 0; % Initial phase in degrees of IComponent
QPhase = 90; % Initial phase in degrees of QComponent
tVector = 0:1/sampleRate:pulseWidth; % Vector to generate ideal pulse
IComponent = chirp(tVector,-bandWidth/2,tVector(end), bandWidth/2,'linear',IPhase);
QComponent = chirp(tVector,-bandWidth/2,tVector(end), bandWidth/2,'linear',QPhase);
IQData = IComponent + 1i*QComponent;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.