butterworth filter(matlab)

Discussion in 'Homework Help' started by TAKYMOUNIR, Oct 6, 2013.

  1. TAKYMOUNIR

    Thread Starter Active Member

    Jun 23, 2008
    351
    1
    i have problem with the last line in this matlab program
    so is there is something wrong in the sentence

    Code ( (Unknown Language)):
    1.  
    2. clear [FONT=Courier New][COLOR=#a020f0][FONT=Courier New][COLOR=#a020f0]all[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New];
    3. close [/FONT][FONT=Courier New][COLOR=#a020f0][FONT=Courier New][COLOR=#a020f0]all[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New];
    4. clc;
    5. n=input([/FONT][FONT=Courier New][COLOR=#a020f0][FONT=Courier New][COLOR=#a020f0]'Enter the order of the butterworth filter:'[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New])
    6. [z,p,k]=buttap(n);
    7. [num,den]=zp2tf(z,p,k)
    8. printsys(num,den,[/FONT][FONT=Courier New][COLOR=#a020f0][FONT=Courier New][COLOR=#a020f0]'s'[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New])
    9. [num2,den2]=lp2lp(num,den,62986)
    10. [H,w]=freqs(num2,den2)
    11. magH=abs(H)
    12. figure(1)
    13. plot(w,magH,[/FONT][FONT=Courier New][COLOR=#a020f0][FONT=Courier New][COLOR=#a020f0]'linewidth'[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New],3)
    14. figure(2)
    15. magHdb=20*log10(magH)
    16.  
    17. plot(w,magHdb,[/FONT][FONT=Courier New][COLOR=#a020f0][FONT=Courier New][COLOR=#a020f0]'linewidth'[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New],3)
    18.  
    19. [/FONT][FONT=Courier New][COLOR=#228b22][FONT=Courier New][COLOR=#228b22]%[w,magH]=ginput(2)
    20. [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New][COLOR=red]cuttoff=min(w(find(magH)<=max((magH/(sqrt(2))))))
    21. [/COLOR][/FONT]
    22.  
     
    Last edited by a moderator: Oct 6, 2013
Loading...