How do I shift a chirp signal to the right?
Mostra commenti meno recenti
Hello,
I have a challenge and I'll really appreciate some help with it.
My goal is to generate and plot the transmit and receive chirp signals on a spectrogram. I understand there a number of ways to do this but the other methods I have tried did not work for me (I probably bungled the code) but the current method does give me what I want save a few issues. The transmit signal is as I intended, showing 2 periods.
%% Given parameters
fc = 4e9; % centre freq, Hz
BW = 8e9; % bandwidth, Hz
Tp = 1e-6; % pulse width, sec
fs = 2*(fc + BW); % sampling freq, Hz
ts = 1/fs;
K = BW/Tp; % chirp rate, Hz/sec
tau = 0.2e-6; % delay, sec
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% TRANSMIT
figure (1)
tee = 0:ts:Tp-ts;
Tx = exp(1j*2*pi*(fc*tee + 0.5*K*tee.^2));
t1 = Tp:ts:2*Tp-ts;
Tx1 = exp(1j*2*pi*(fc*(t1-Tp) + 0.5*K*(t1-Tp).^2));
Tx_signal = [Tx Tx1];
Tx_signal = Tx_signal/150;
spectrogram(Tx_signal,256,250,1024,fs,'yaxis');
colorbar;
caxis([-155,-98]);
ylim([0,20]);
Problems starts when I try to generate the receive signal. I have used the range equation to determine it should be start at tau = 0.2μsec on the x-axis in the first period and at Tp+tau in the second period. That is, I want to shift the transmit signal to the right by tau, to get the receive signal (since I am using the same chirp rate and single object). I used the code below to try to implement the shift.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% RECEIVE
figure (2)
t2 = tee-tau;
Rx = exp(1j*2*pi*(fc*t2 + 0.5*K*t2.^2));
t3 = t1-tau;
Rx1 = exp(1j*2*pi*(fc*(t3-Tp) + 0.5*K*(t3-Tp).^2));
Rx_signal = [Rx Rx1];
Rx_signal = Rx_signal/150;
spectrogram(Rx_signal,256,250,1024,fs,'yaxis');
colorbar;
caxis([-155,-98]);
ylim([0,20]);
Instead of shifting horizontally, the signals has shifted vertically. When combined, they look like this...
% TX AND RX
figure(3)
final = [Tx Rx Tx1 Rx1];
final = final/150;
spectrogram(final,256,250,1024,fs,'yaxis');
colorbar;
caxis([-155,-98]);
ylim([0,20]);
Question
How do I get the rx signal to shift horizontally (from 0.2μ to 1.2μ and 1.2μ to 2.2μ) instead of vertically? The max t-axis should be 2.2μ not 4μ
Thank you so much in advance.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Signal Attributes and Indexing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


