Search code examples
matlabfiltersignal-processingsar

apply low-pass analog filter to an analog signal in matlab


Suppose that I'm simulating SAR signal processing in matlab. You know a block diagram like this :
enter image description here
Here's what I have tried up to now.

t = 0:0.01:10;
f0 = 10^(-6);
t1 = 1;
f1 = 100;
y = chirp(t,f0,t1,f1,'linear');
%starting to generate I's
y1Modulated = y.*cos(2*pi*f0*t);
y1ModulatedFrequencyDomain = fft(y1Modulated);  

As you see in the diagram the signal entering the low-pass filter is an analog one. So we should use filters in

matlab ---> signal processing toolbox ---> Analog and Digital filters ---> Analog filters  

But I don't know which to use or how to obtain parameters of functions like: besselap , cheblap and so on?


Solution

  • There are many ways to implement what you are trying to do. Here is one way to write the code for your block diagram:

    % define some simulation parameters
    fs = 80e6;      % sample rate of 80 MHz
    f0 = 10e6;      % frequency of your complex mixer
    
    % generate the chirp with whatever parameters you need
    t = 0:1/fs:1000*1/fs;
    y = chirp(t,9e6,6.25e-6,11e6);
    
    % add a bit of noise to make the simulation more realistic
    % here we make the signal-to-noise ratio approximately 40 dB
    y = awgn(y,40,'measured');
    
    % apply the complex mixing
    y2 = y.*exp(j.*2.*pi.*f0.*t);
    
    % create an example lowpass filter and filter the signal to remove images
    [b,a] = butter(8,0.1);
    y3 = filter(b,a,y2);
    
    % plot the signals to see what they look like
    figure(1);
    plot(t,y);
    grid on;
    title('Received Chirp Signal (time domain)');
    figure(2);
    plot(linspace(-fs/2,fs/2,length(y)),20.*log10(abs(fftshift(fft(y)))));
    grid on;
    title('Received Chirp Signal (frequency domain)');
    xlabel('frequency (Hz)');
    ylabel('dB');
    axis([-fs/2 fs/2 -30 40]);
    
    figure(3); hold on;
    plot(t,real(y3));
    plot(t,imag(y3),'r');
    grid on;
    title('Baseband Chirp Signal (time domain)');
    figure(4);
    plot(linspace(-fs/2,fs/2,length(y3)),20.*log10(abs(fftshift(fft(y3)))));
    grid on;
    title('Baseband Chirp Signal (frequency domain)');
    xlabel('frequency (Hz)');
    ylabel('dB');
    axis([-fs/2 fs/2 -30 40]);
    

    enter image description here enter image description here enter image description here enter image description here

    Now, you also asked which low-pass filter design to use. This depends entirely on what you are trying to achieve, and you need to specify a filter to meet your requirements. In my example above I have used an 8th order Butterworth design. But often an FIR filter is used in order to achieve a linear phase response.