# How to perform dechirping of SAR image in MATLAB?

I have the transmitted pulse and the raw SAR image before range compression (dechirping). I understand the pulse compression its a convolution along the columns but I am not able to make it work. I've tried this:

   h_compressed = conv2(fliplr(conj(g)), 1, Dr, 'same');


Where g is the transmitted chirp and Dr is the raw SAR image.

• Is this really a new question or just a slight variation to your previous question? You have reacted to none of the comments nor to the answer to that, so I'm slightly reserved about this question. – Marcus Müller Jan 4 '20 at 1:44
• Correction: you did add a few interesting images (my browser had the last version of your question cached)! Anyways, "I am not able to make it work" isn't really a description of what goes wrong, and you should really clarify how this differs from your previous question, I think. – Marcus Müller Jan 4 '20 at 1:58
• Yeah I think maybe my previous question was not clear enough so I updated it to this. It is still the same issue – Ben Romarowski Jan 4 '20 at 1:58
• You should rather clear up your previous question, then, and tell the author of the answer you've gotten why her/his answer doesn't help you. – Marcus Müller Jan 4 '20 at 1:58
• ok, do you know why this matched filter does not work tho? – Ben Romarowski Jan 4 '20 at 2:00

Dechirping is a bit different than matched filtering, but perhaps that not important here.

The code you have looks like it should work if the variables are as you describe. Here is a hypothetical example that range compresses an LFM pulse. The reflected signal from an actual target in the scene is a just a delayed version of the waveform, so it will just be a shifted version of what you get when you range compress the transmitted pulse itself:

Tp = 10e-6;              % Pulse length (s)
Brf = 200e6;             % Bandwidth (Hz)
fs = 1.2 * Brf;          % Sampling frequency (Hz)
Ns = ceil( Tp * fs );    % Number of samples per pulse

% Vector of time samples (s)
t = 1/fs * ( -Ns/2 : Ns/2 - 1 ).';

% The LFM waveform.
lfm = exp( 1j * pi * Brf / Tp * t.^2 );

% Matched filter the pulse.
rngcomp = conv2( flipud( conj( lfm ) ), 1, lfm );

% Display the magnitude of the IPR.
plot( 20*log10( abs( rngcomp ) ) );