Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Undefined variable or function 'b'
Replies: 1   Last Post: May 10, 2013 1:28 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Jacob

Posts: 1
Registered: 5/10/13
Undefined variable or function 'b'
Posted: May 10, 2013 1:20 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I don't understand why it's not reading from the script when I enter these commands

figure(1);
subplot(2,1,1), zplane(b),title('zplance of FIR'), ylabel('Imaginary part'), xlabel('Real Part')
subplot(2,1,2), plot(w,abs(fr)),title('Magnitude of Frequency Response'), ylabel('Amplitude'), xlabel('w(pi)')

it always says undefined variable 'b'
Ive made sure its headed to the right folder and everything.

Here is my code:

FIR_Input1c ='C:\Users\niel0512\Desktop\DSF\FIR_Input1c';
[X, FS, NBITS] = wavread(FIR_Input1c);

FIR_Input1 = 'C:\Users\niel0512\Desktop\DSF\FIR_Input1';
[O, FS, NBITS] = wavread(FIR_Input1);


z1 = exp(.3*pi*1i);
z2 = exp(-.3*pi*1i);
z3 = exp(.5*pi*1i);
z4 = exp(-.5*pi*1i);
z5 = exp(.8*pi*1i);
z6 = exp(-.8*pi*1i);
z7 = -1;

b=conv([1, -z1],[1, -z2]);
b=conv(b,[1,-z3]);
b=conv(b,[1,-z4]);
b=conv(b,[1,-z5]);
b=conv(b,[1,-z6]);
b=conv(b,[1,-z7]);

b = b./8;
a = 1;

[fr,w]=freqz(b,1,-pi:pi/1000:pi);

y= filter(b,a,X);
y= real(y);



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.