Signal integrator with biquad~ or gen~
Hello,
I'm attempting to make a MSP version of a Simulink model of a loudspeaker that I found on Daniel San Ausín's Thesis (page 8). Please see the attached file for the signal flow chart.
It's "quite simple", just additions and multiplications.
The parameters Le, Re, Bl, Mms, Rms, Cms are the Thiele & Small parameters of a loudspeaker (it's just floating values).
The input voltage can be a sinus, a noise or whatever.
The quite complicated bloc is the "1/s". It's an integrator.
I tried to build it using the biquad~ function first with a/b coefficeints and then using the gen~ function with history to store the previous values.
There are 3 ways of integrating a signal in discrete time:
- Euler Forward: y[n] = Ts.x[n-1] + y[n-1]
- Euler Backward: y[n] = Ts.x[n] + y[n-1]
- Bilinear or Trapezoidal: y[n] = (Ts/2).x[n] + (Ts/2).x[n-1] + y[n-1]
So if I follow the last way, the parameters are the following:
a0=Ts/2, a1=Ts/2, a2=0, b1=-1, b2=0
y[n] = a0.x[n] + a1.x[n-1] + a2.x[n-2] - b1. y[n-1] - b2. y[n-2]
I don't know what's wrong with my patch. Maybe it's just not possible to do it with MSP ?