Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

where is the error in my matlab code?

Status
Not open for further replies.

laham

Newbie level 6
Joined
Mar 30, 2006
Messages
11
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,283
Activity points
1,357
i want to know where is my error in my matlab code ?
i want to record my voice using matlab and modulate it and demodulate using am mathematical procedures (imean not using modand demod commands)
and want to plot the every satge signal and play it.
this is my code
fc=1000;
fs=8000;
ts=1/fs;
Ac=4;
m=0.25;
t=0:ts:4.999875;
c=cos(2*pi*fc*t);
i=wavrecord(5*fs,fs);
plot(t,(i'))
wavplay(i,fs)
pause
s=Ac*(1+(m.*(input'))).*c;
plot(t,s)
wavplay((s'),fs)
pause
w=s.*c;
[num,den]=butter(9,0.025);
v=filter(num,den,w);
plot(t,v)
wavplay((v'),fs)
 

echo47

Advanced Member level 5
Joined
Apr 7, 2002
Messages
3,942
Helped
637
Reputation
1,272
Reaction score
88
Trophy points
1,328
Location
USA
Activity points
33,183
What type of modulation are you attempting?

"input" without any parameters is a syntax error in my MATLAB 7.3. What is it suppose to do?
 

laham

Newbie level 6
Joined
Mar 30, 2006
Messages
11
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,283
Activity points
1,357
it is AM modulation

and wat parameter for the input do you mean to be included?
 

Drago

Member level 3
Joined
Nov 14, 2005
Messages
56
Helped
9
Reputation
16
Reaction score
3
Trophy points
1,288
Location
Bulgaria
Activity points
1,643
Try to replace the variable "input", which is not defined with the recorded audio, which in your case is "i"
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top