# MATLAB, recover a signal that has a cosinusoidal interference and that has been AM modulated

I have a signal which has been AM modulated but the channel also added a cosinusoidal interference A cos(2 * Pi * f0 * n * Tc + Phase), at the same f0 frequency of modulation. Tc is the sampling period.

I am given the distorted signal x(nTc) and I need to recover the original signal v(nTc)

I also have the filter coefficients of two filters:

A) a notch filter centered at 16KHz;

B) a low pass filter;

I started by calculating the fft of x(nTc) and it has a big peak at 7500 Hz, which is my f0 Now I need to eliminate the cosinusoidal interference and the notch filter seems to be the right way to do it but it is centered at 16KHz, so I have to center it at 7500Hz. To do so I used this Fourier transform property: exp(j * w0 * n)x(n) -> X(j(w-w0)). In my case I need to multiply the filter coefficients of the notch filter by exp(j * 2 * Pi * 8500 * n * Tc) Everything should be good, so now I can filter the x(nTc) signal using input_without_interference = filtfilt(notch_coeff,1,x(nTc))

At this point I have to AM demodulate the signal. Demodulation is accomplished by multiplying the signal by the same carrier that modulated it, in this case cos(2 * Pi * f0 * n * Tc) To do so I used this code:

for k=0:length(input_without_interference))-1
dem_signal(k+1) = cos(2 * Pi * 7500 * k * Tc) * input_without_interference(k+1);
end


Now If I plot the signal dem_signal it still shows some traces of modulation so something is certainly wrong.

Assuming everything went good, I now have many replicas of the original signal v(nTc) and one of them is centered in the origin, so to take it I just need to use the low pass filter. v(nTc) = filtfilt(lowpass,1,dem_signal)

Result: the output is still distorted and it has an imaginary component! Where is my mistake?

• Could you share your entire script? Also, is this homework? Note that it's not surprising that your result would have an imaginary component, because the coefficients of your frequency-shifted notch filter are complex. – Jason R May 22 '15 at 15:26
• I agree with Jason R. You're causing problems for yourself by using a filter with complex-valued coefficients. I suggest you discard that notch filter centered at 16 kHz altogether and use a real-coefficient, narrowband, notch filter whose center freq is 7.5 kHz.Another option is to reduce the magnitude of the – Richard Lyons May 23 '15 at 12:21
• I suggest you discard that notch filter centered at 16 kHz altogether and use a real-coefficient, narrowband, notch filter whose center freq is 7.5 kHz. Another option is to modify x(nTc)'s FFT spectral samples by reducing the magnitude of the "big" +7.5 kHz spectral component (as well as reduce the magnitude of the "big" -7.5 kHz spectral component) and then perform an inverse FFT. Doing that will produce time-domain samples. Next, perform your demodulation process on the real part of your time-domain samples. – Richard Lyons May 23 '15 at 12:34