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
I also have the filter coefficients of two filters:
A) a notch filter centered at
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
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?