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.

Check this Matlab code for down sampling a cos signal

Status
Not open for further replies.

ednan

Advanced Member level 4
Joined
Feb 13, 2007
Messages
118
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Activity points
2,059
i hav cos signal n i want to do down sample by 2..is this matlab code is correct ...

n=1:20;
x=cos(2*pi*n/10);
y=zeros(1,60)
for ii=1:20;
y(3*ii)=x(ii)
end

figure;

stem(n,x)

figure
stem(y)

n1=1:20;
N=1000;
x1=cos(2*pi*n1/N)
imp_train=zeros(1,50)
imp_train(1)=1;
train=imp_train;
for i=1:19
train=[train imp_train]
end
figure;

stem(x1)

figure
stem(imp_train)
title('imp_train')

figure;
stem(train)
title('train')

sampled=train.*x;
figure;
stem(sampled);
title('Sampled')


plz help me if m doing wrong...
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top