Frequency spectrum of complex equivalent Baseband Signal - Frequency Content around carrier frequency Basically my objective is to generate a complex equivalent baseband signal of an AM modulated wave in MATLAB. Then to view the difference in frequency spectrum of AM modulated RF signal vs complex equivalent baseband of (AM modulated RF signal).

I generated an equivalent complex baseband signal for an AM modulated signal and when viewing the spectra of complex baseband signal, I see frequency content centered at 0 but too many frequency content around carrier frequency as well. 

Could anyone let me know why I am seeing frequency content around carrier frequency as well?

Here are the steps I followed:


Generated a carrier signal and message signal.
Did AM modulation.
Generated Inphase and Quadrature components.
Then represented complex baseband signal by $x_{bb}(t)=x_i(t)+jx_q(t)$
View the frequency spectra of AM modulated wave.
View the frequency spectra of Complex baseband signal.


When I compare the spectra, I see that the spectra of complex baseband signal is centered around 0 but has frequency components at the carrier frequency range (both positive and negative). Here are the screenshots:


Spectra - AM modulated signal

Spectra - Equivalent complex baseband signal




Here is my MATLAB code:

fs=15000;
t=0:1/fs:1;
fm=5;
m=sin(2*pi*t*fm);  %message signal 
%plot(t,m,'b');                   
fx=1000;
x=cos(2*pi*t*fx); %carrier signal
xm=m.*x;  %AM
ax=subplot(2,1,1);
plot(ax,t,m,'b');
axm=subplot(2,1,2);
plot(axm,t,xm,'g');
hx=imag(hilbert(xm)); %hilbert transform

xit=(xm.*cos(2*pi*fx*t))+(hx.*cos(2*pi*fx*t));
xqt=(hx.*cos(2*pi*fx*t))-(xm.*sin(2*pi*fx*t));

xbb=xit+(1i*xqt); %equivalent complex baseband signal
figure(2)
plot(t,xbb);

%spectrum
nfft=1024;
F=fftshift(fft(xm,nfft));      %spectra of AM modulated wave
fvals=fs*(-nfft/2:nfft/2-1)/nfft;
figure(4);
stem(fvals,abs(F),'b');

%spectrum
nfft=1024;
F=fftshift(fft(xbb,nfft));  %spectra of equivalent complex baseband
fvals=fs*(-nfft/2:nfft/2-1)/nfft;
figure(5);
stem(fvals,abs(F),'b');
You have a bug in the formulation of your complex heterodyne oscillator signal inside your complex multiplication.  This seems to be creating both sum and difference frequency results.  Thus the extra high-frequency spectrum.