AM Demodulation using MATLAB

Hey all, I am having some trouble with AM demodulation using MATLAB. I used the built-in MATLAB function butter to design a low pass filter and using the transfer function obtained, I filtered the modulated signal multiplied by the carrier. Here's the part of my m-file which deals with it:

dam=cos(2*pi*250*t).*am; % am=amplitude modulated signal [b,a]=butter(5,250*2*Ts); %designing low pass filter with corner freq

250Hz, Ts-sampling %interval dam(:,1) = filtfilt(b,a,dam(:,1)); % filtering the demodulated signal dam=dam*2; %scaling to get original amplitude back

the problem is that I'm trying to filter the signal without using the built in matlab functionality. I tried to multiply the transfer function of filter with the fourier transfer of dam (fft(dam)) to low pass filter it and then took the inverse fft of the answer, but came up with a weird answer when i tried to plot the demodulated signal.

could someone tell me what i'm doing wrong when i am trying to filter it? Is there any other way around this without using built-in matlab functions? Thanks a lot in advance. -Farah.

Reply to
farah727rash
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.