Hello. I am new in matlab simulation.
I want to generate the below signal:
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.
|
|
0
|
|
|
|
Reply
|
Md
|
8/31/2010 2:23:09 PM |
|
Am 31.08.2010 16:23, schrieb Md. Nazmus Sakib:
> Hello. I am new in matlab simulation.
> I want to generate the below signal:
>
> 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);
|
|
0
|
|
|
|
Reply
|
Daniel
|
8/31/2010 3:07:10 PM
|
|
Daniel Goerke <danielgoerke@gmx.net> wrote in message <i5j5qs$9ch$4@news-cypress.fernuni-hagen.de>...
> Am 31.08.2010 16:23, schrieb Md. Nazmus Sakib:
> > Hello. I am new in matlab simulation.
> > I want to generate the below signal:
> >
> > 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.
|
|
0
|
|
|
|
Reply
|
Md
|
8/31/2010 6:47:18 PM
|
|
Am 31.08.2010 20:47, schrieb Md. Nazmus Sakib:
> Daniel Goerke <danielgoerke@gmx.net> wrote in message
> <i5j5qs$9ch$4@news-cypress.fernuni-hagen.de>...
>> Am 31.08.2010 16:23, schrieb Md. Nazmus Sakib:
>> > Hello. I am new in matlab simulation.
>> > I want to generate the below signal:
>> >
>> > 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
|
|
0
|
|
|
|
Reply
|
danielgoerke (1)
|
8/31/2010 8:00:23 PM
|
|
Daniel Goerke <danielgoerke@gmx.net> wrote in message <i5jn0m$9ch$5@news-cypress.fernuni-hagen.de>...
> Am 31.08.2010 20:47, schrieb Md. Nazmus Sakib:
> > Daniel Goerke <danielgoerke@gmx.net> wrote in message
> > <i5j5qs$9ch$4@news-cypress.fernuni-hagen.de>...
> >> Am 31.08.2010 16:23, schrieb Md. Nazmus Sakib:
> >> > Hello. I am new in matlab simulation.
> >> > I want to generate the below signal:
> >> >
> >> > 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
|
|
0
|
|
|
|
Reply
|
sakibnaz
|
9/1/2010 7:57:24 AM
|
|
hello there im really new in matlab programming i need a help to make this. i need to write a matlab program that show Double Side Band Suppress Carrier AM (DSBSC-AM) with a carrier frequency fc = 200Hz and modulating frequency fm = 2Hz.
> Plot AM signal vs time
>Spectrum vs frequency
i hope u can response as soon as possible sir i really need help on this..ty :D
|
|
0
|
|
|
|
Reply
|
rayzour (1)
|
11/13/2012 9:39:51 PM
|
|
|
5 Replies
691 Views
(page loaded in 0.097 seconds)
|