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 showing how a square wave is changed to raised cosine for pulse shaping

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 asked to show how a square wave is changed to raised cosine for pulse shaping. what i did was generated sequence of rectangular pulses and then passed it through firrcos filter. but teacher now said that i shouldnt be doing it this way

i m supposed to generate a square wave and then from it subtract a cosine wave to get raised cosine wave. i did it but the shape i got was not correct. it was like half rectified sinusoid.
any suggestions?

x=(1:0.1:3); %array for x axis of square wave
r=[1 0 1]; % input wave
k=1:30;k=1;
x2 = pi:pi/9:2*pi; %for sine wave
for i=1:3
if r(i)==1
x(k:k+9)=1; % square pulse generation
y(k:k+9) = sin(x2)+1; %sine pulse generation equal in width to square pulse
k=k+10
elseif r(i)==0
x(k:k+9)=0;
y(k:k+9) = 0;
k=k+10
end
end
stairs(x,'r');
hold on;
stem(y)
figure(2)
t=x-y; %taking difference of two waves to get the required shape
plot(t)


what it does is generate a negative half of sine wave and subtract it from square wave pulse and do nothing if input is zero
the output plot is not correct.
how to correct it.......help plz
 

raised cosine formula

Your first approach of using a FIR filter seems good. It removes the higher harmonics and leaves a cosine wave.

The teacher's request doesn't make sense to me. Ask him to explain it again.
 

Re: raised cosine

the teacher repeated the same old thing:cry:
 

raised cosine

Hi there!
The raised cosine pulse is given by the formula:

w[n] = 1/2[ 1 - cos(2*pi*n/M) , 0 < n <M
w[n]=0 otherwise

which can be viewed as a retangular pulse subtracted by a cosine.

So, that's why you teacher is insisting in his answer.

good luck
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top