x(t)={ t+1, 0<=t<1
-t+2, 1<=t<=2
5, Otherwise
}
& after generating need to amplitude modulate (both DSB-SC & DSB-LC) with 100Hz carrier.
Can any body give me example for generate & modulate the signal? Urgent please.
Thanks.
Nazmus.
Hi,
for me it looks like it makes much more sence for at least 10kHz, but
you can figure that out as well as the number of discretization points
to use...
Try this:
pi=3.14;
nCarrierFrequency=10000;
t=0:0.001:4.999;
x=zeros(1,5000);
for counter=1:5000
if (t(counter)>=0 && t(counter)<1)
x(counter)=t(counter)+1;
elseif (t(counter)>=1 && t(counter)<2)
x(counter)=-t(counter)+2;
else
x(counter)=5;
end
end
carrier(:,1)=cos(2*pi*nCarrierFrequency*t(1,:));
signal=carrier.*x';
figure();
plot(t, x);
figure();
plot(t, carrier);
figure();
plot(t, signal);
Thank you very much. Its a nice code.
I have also generated the signal x(t) using linespace, that's a poor solution I know.
Some more query please . . .
here the modulation happens at the line,
signal=carrier.*x'; its DSB-SC I think.
Could u please tell me some more functions,
1. DSB-FC of x(t)
2. power content of the modulated signal
3. spectrum of the modulated signal &
4. power spectral density of the modulated signal
I can do the plot, just want to know the functions. Actually I am very new.
Thanks.
Nazmus.
Hi Nazmus,
I actually don't know exactly about the equations you should use for
DSB-FC and DSB-SC. Im not so much involved in AM, sorry...
You could have a look to the Matlab Central, since some people may have
already coded somethink to do your job.
To calculate the power content, you could use trapz to integrate your
curve and find the area which should correspond to the power.
To calculate the frequency specturm you can use abs(fft(signal)) to get
the real valued frequency spectrum of your signal.
Regards,
Daniel
Hi Daniel.
Thanks my code is done. I have used FFT & PSD function for feq spectra & power spectral density.
-Nazmus