I am new to DSP and i am trying to take a wav (human speech) file and apply ARMA filter and plot its PSD graph in python.

I see that there are a lot of AR implementations but almost none ARMA. I found only statsmodel that implemented ARMA but it requires the data to be stationary (but sound with lags of 30 is almost stationary)

Does anyone have a working piece of code that i can use to plot? If not, i will be happy to get some reference on how to implement it.

Thanks in advance!

  • $\begingroup$ Awesome. Just the other day I noticed that people were using ARMA for speech. I am guessing that when LPC was developed for speech, more than 40 years ago, it would been expensive to do the calculations which could explain why they chose a model that is simpler than ARMA. $\endgroup$ Aug 25, 2017 at 11:47
  • $\begingroup$ are you looking to estimate the ARMA parameters? $\endgroup$
    – user28715
    Oct 24, 2017 at 16:41

1 Answer 1


I dont know in Python, but this simple matlab/octave loop code:

function y=arma(x,A,B)
for i=na:n

Implements a ARMA filter, with polynomials $A$, $B$, such as per this 5th order filter:

A=[1 0 0 0 0 0];
B=[0 0.2 0.2 0.2 0.2 0.2];
n=1000; dt=0.001; 
plot(t,[x y]);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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