Sign in

username or email:

password:



Not a member?
Forgot your password?

Search code



Search tips

Ads

See Also

Embedded SystemsFPGA

DSP Code Sharing > FIR - LPF -Window based in scilab

FIR - LPF -Window based in scilab

Language: Scilab

Processor: Not Relevant

Submitted by Senthilkumar R on Mar 22 2011

Licensed under a Creative Commons Attribution 3.0 Unported License

FIR - LPF -Window based in scilab


 

Scilab Program to design a FIR Low Pass Filter- Window Based Technique

 
//Program to design a FIR Low Pass Filter- Window Based
//Technique
clear all;
clc;
close;
M = 7             //Filter length = 7
Wc = %pi/4;        //Digital Cutoff frequency
Tuo = (M-1)/2     //Center Value
for n = 1:M
    if (n == Tuo+1)
      hd(n) = Wc/%pi;
    else
      hd(n) =  sin(Wc*((n-1)-Tuo))/(((n-1)-Tuo)*%pi);
  end
end
//Rectangular Window
for n = 1:M
  W(n) = 1;
end
//Windowing Fitler Coefficients
h = hd.*W;
disp('Filter Coefficients are')
h;
[hzm,fr]=frmag(h,256);
hzm_dB = 20*log10(hzm)./max(hzm);
plot(fr,hzm_dB)
xlabel('Normalized Digital Frequency W');
ylabel('Magnitude in dB');
title('Frequency Response 0f FIR LPF using Rectangular window M=7')
 
Rate this code snippet:
0
Rating: 0 | Votes: 0
 
   
 
posted by Senthilkumar R



Comments


 

UNGY_STARS wrote:

1/19/2012
 
hello sir,

I have to design FIR-LPF window based filter for this i am using above code.  Here there are two inputs:- M = 7             //Filter length = 7
Wc = %pi/4;        //Digital Cutoff frequency
and calculating center value
Tuo = (M-1)/2     //Center Value

can specify me general way to calculate cutoff frequency and center value because i have to design general FIR-LPF not for a particular case.
 

Arun Prakash wrote:

2/24/2012
 
Sir,
I need a small hlep how to calculate in modulo  values in scilab with fourier transform.
 

UNGY_STARS wrote:

3/13/2012
 
still waiting for positive response...........

Add a Comment
You need to login before you can post a comment (best way to prevent spam). ( Not a member? )