Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem with code for getting plots of rectangular pulse and then raised cosine pulse

Status
Not open for further replies.

mujee

Member level 1
Joined
Feb 11, 2007
Messages
37
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,585
hi guys
i have been trying to get plots of rectangular pulse and then a raised cosine pulse by first generating a rectangular pulse and then filtering it through firrcos filter but i m not getting the results

can anyone help me with code.....

x=round(rand(1,16000));
xk=(-1).^x; % BPSK symbols

xup=upsample(xk,100);
a=sqrt(100)*firrcos(255,0.01,1,2,'rolloff','sqrt');
x_Tx=filter(a,1,xup);

i have used this code because this was given to us in our first assignment.

there are few confusions in it too...first what would the ouptut of filter function be....i have checked matlab help but it doesnt say anything what does the function 'filter' outputs...i was trying to plot the output of filter function (because if it shapes the rectangular pulse then its output should be the reshaped rectangular pulse) but it didnt produce that raised cosine wave. which clearly shows there is something more going on which i really dont know
so can anyone help?

please help me to get the correct shape of raised cosine pulse
 

help needed badly :(

Hi

your code is working perfectly, you can not see it clearly because the input impulses are too close to each other, I modified your code, run this

x=round(rand(1,16));
xk=(-1).^x; % BPSK symbols
xup=upsample(xk,300);
x=round(rand(1,16));
a=sqrt(100)*firrcos(255,0.05,1,2,'rolloff','sqrt');
x_Tx=filter(a,1,xup);
plot(x_Tx);

If you zoom in the plots you can see the rised cosine outputs, however keep in mind this

- You are not sending rectangular pulses but impulses to the input of the filter.

If you think this info is useful click on "helped me" for statistics

Sal
 

    mujee

    Points: 2
    Helpful Answer Positive Rating
Re: help needed badly :(

thnx alot sal...it really solved my prob
u shouldnt have asked for hitting 'helpled me' , i would have done it anyways

but one thing i want to know why impulses as input...care to elaborate this concept a bit
 

help needed badly :(

Because it is like unity (1) in multiplication if you have y*1 = y, it is the same the impulse response of rised cosine filter can be obtained sending an "impulse" as its input. In you case you are sending many, and polarized (+/- 1) then you get the plots you get. It is a very basic concept about how to characterize filters. if you send a rectangular signals you get a composed output, which is not exactly y, it si x*y, got it? you can read more in the internet if you look for "impulse response"

cheers

Sal
 

    mujee

    Points: 2
    Helpful Answer Positive Rating
Re: help needed badly :(

yeah i know about impulse response. all i wanted to ask was why in my case its impulse as input n not rectangular pulse

anyways thanx for ur help...u raally saved my ass
cheers
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top