0
$\begingroup$

To put things into perspective, I initially had these four graphs in MATLAB, whose data were sampled with a rate of 10 samples/sec :-

enter image description here

I wanted to remove some of the spikes on the blue graphs, so I thought about making a lowpass-filter that would take care of that. I used the command d = designfilt('lowpassfir','Filterorder', 5, 'CutoffFrequency',0.1,'SampleRate',10) . I then put the data from the blue graph through the filter, and plotted again. Now they look like this:-

enter image description here

As can be seen, some of the spikes have been removed and the graph have been smoothed out, which is what I desire. However, now I want to get the transfer function for the filter, but the only output I get in MATLAB is

d = 

 digitalFilter with properties:

         Coefficients: [0.0287 0.1430 0.3283 0.3283 0.1430 0.0287]

   Specifications:
    FrequencyResponse: 'lowpass'
      ImpulseResponse: 'fir'
           SampleRate: 10
      CutoffFrequency: 0.1000
          FilterOrder: 5
         DesignMethod: 'window'

So my question is, can I just translate the coefficients directly into a transfer function of 5th order and with no zeroes? Like this:- $$H(s) = \frac{1}{0.0287s^5 + 0.1430s^4 + 0.3283s^3 + 0.3283s^2 + 0.1430s + 0.0287} $$

If not, how can I get the transfer function from my designed filter?

Also, I didn't rigorously derive the arguments for the designfilt command (filterorder, cutoff frequency) I just guessed at some appropriate values.

$\endgroup$
1
1
$\begingroup$

The filter is a discrete FIR filter, so the transfer function would be given as:

$$H(z) = .0287 + 0.1430z^{-1} + 0.3283z^{-2} + 0.3283z^{-3}+0.1430z^{-4}+0.0287z^{-5}$$

With the frequency response given by using the unit circle for the complex variable $z$, as in $z = e^{j\omega}$ for $\omega \in [0, 2\pi)$, with the sampling rate normalized to $\omega = 2\pi$. You can use the freqz command in Matlab to plot or return the frequency response:

freqz([0.0287 0.1430 0.3283 0.3283 0.1430 0.0287])

Which creates a plot similar to what I have done using Octave below for these coefficients:

enter image description here

The frequency axis will be normalized to the radian angular sampling frequency, but you can refer to Matlab's documentation for other parameters that can be passed in to freqz to scale the frequency otherwise.

$\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.