0
$\begingroup$

I designed the filter below on paper:

FIR
low pass
type 1
length 3
alpha = 6
beta = -12
allow freq. <= 0.1rad/sample
blocked freq. >= 0.4rad/sample

To confirm that my calculations are correct I was planning to design the filter on MATLAB. Is there a function to design this filter, apply an input frequency and check the output result?

$\endgroup$
  • $\begingroup$ What is alpha and beta? $\endgroup$ – Matt L. May 11 '15 at 16:07
  • $\begingroup$ Sorry for not explaining. h[0] = ∝ h[1] = β h[2] = ∝ therefore: H(ejw) = ∝ + β e^-j1w + ∝ e^-j2w $\endgroup$ – dritech May 11 '15 at 21:04
  • $\begingroup$ Also, type 1 is the symmetry type. Type 1 is when the order is odd and the number of samples is even. $\endgroup$ – dritech May 11 '15 at 21:08
  • $\begingroup$ @MattL. Please see replies above. Thanks $\endgroup$ – dritech May 11 '15 at 22:45
  • 1
    $\begingroup$ @dritech : Please add your solution as an answer below, and accept it (once the system lets you). It will possibly help others with similar problems. $\endgroup$ – Peter K. Sep 8 '15 at 18:49
1
$\begingroup$

Like Matt L. pointed out, alpha and beta is unclear as is 'type 1'.

You can use the command fdatool to interactively design filters in MATLAB, although you may need the DSP system toolbox installed.

From there, you can apply the filter using the filter() function.

As an example, if you design the filter using FDAtool, and the filter is an FIR, you can use filter(Hd.numerator,1,X,Fs) if Hd is your filter object, X is the input sequence, and Fs is your sampling rate. This is not the only way to do this, but just the way I would go about it.

X could be generated as a sin(2*pinf*t) where t = 1/fs and n is an index in a for loop or shortened to 1:ns for the number ns you wish to have your input sequence have as a length.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.