Reports until 18:54, Thursday 06 July 2023
cSQZ General
hudsonl - posted 18:54, Thursday 06 July 2023 (11252)
Red Pitaya IIR Filter
The Red Pitaya infinite impulse response (IIR) filter has some quirky behavior, which I'll document below.

The IIR module wants to be fed zeros and poles, these values correspond to frequencies (not radians/second) and should have negative real parts to make a stable filter. The software will not throw an error if it is fed positive values for the poles and zeros and will just create an unstable filter.

The parameter "loops" sets the down-sampling rate of the filter and as far as I can tell, should usually be set to its maximal value of 1023 for audio-band signal processing. With this value, the FPGA's sampling rate will be 125MHz/1023 = 125kHz. The IIR gain sets an overall amplification of the IIR filter. For example, to make an IIR filter sampled at 125kHz with a zero at 100Hz, a pole at 5Hz, and a gain of 10 the commands are:

zeros = [-100]
poles = [-5]
gain = 10
loops = 1023
p.rp.iir.setup(zeros=zeros, poles=poles, gain=gain, loops=loops)

where "p" is the name of the red pitaya being used.