1
$\begingroup$

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!

$\endgroup$
  • $\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$ – richard mullins Aug 25 '17 at 11:47
  • $\begingroup$ are you looking to estimate the ARMA parameters? $\endgroup$ – Stanley Pawlukiewicz Oct 24 '17 at 16:41
0
$\begingroup$

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

function y=arma(x,A,B)
na=length(A);
n=length(x);
y(1:na,1)=zeros(na,1);
for i=na:n
    y(i,1)=1/A(1)*A(2:na)*y(i-1:-1:i-na+1)+1/A(1)*B*x(i:-1:i-na+1);
end

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; 
t=dt*(0:n-1)';
x=randn(n,1);
y=arma(x,A,B);
plot(t,[x y]);
$\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.