Linear Trapezoidal Integrated SVF vs Direct Form

Embed Size (px)

DESCRIPTION

Linear Trapezoidal integrated SVF vs Direct Form 1and other variations with 32-bit floating point numbers

Citation preview

  • Linear Trapezoidal integrated SVF vs Direct Form 1 and other variations with 32-bit floating point numbers

    (c) Andrew Simper, Cytomic, [email protected]

    Which filters are being compared:

    svf f32 = svf trapezoidal integrated all single precisionlad f32 = normalized ladder all single precisiondwf f32 = direct wave form biquad all single precisiondwf2 f32 = direct wave form biquad L2 normalised all singel precisiondf1 f32 = direct form 1 biquad all single precisiondf2t f32 = direct form 2 biquad transposed all single precision

    Bell 20Hz, time domain error 20Hz bell, 48kHz samperate

    The input test signal: is the sum of sin waves 20, 200, 2000, 20000 hz with the frequency, with an additional sin wave added at the cutoff frequency of the filter, the time of the input signal is 0.5 seconds.

    The processed signal is subtracted in the time domain from the "perfect" output calculated at 100 bits using the gnu gmp library.

    0 5000 10 000 15 000 20 000

    -1.0

    -0.5

    0.0

    0.5

    1.0

    svf f1000 HidealL processed signal

  • 0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0svf f32 time domain error

    0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0lad f32 time domain error

    0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0dwf f32 time domain error

    0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0dwf2 f32 time domain error

    2 SVF-vs-DF1.nb

  • 0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0df2t f32 time domain error

    0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0df1 f32 time domain error

    Bell 20Hz, quantization error spectrum 20Hz 2Q 12dB bell, 48kHz samplerate

    The same setup as above but the fft is taken and the sin signals notched out. The rms amplitude of the spectrum is shown in the title.

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60svf f32 quantization error rms amplitude -111.08 dB

    SVF-vs-DF1.nb 3

  • 0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60lad f32 quantization error rms amplitude -107.931 dB

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60dwf f32 quantization error rms amplitude -63.3597 dB

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60dwf2 f32 quantization error rms amplitude -63.2012 dB

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60df1 f32 quantization error rms amplitude -58.9096 dB

    4 SVF-vs-DF1.nb

  • 0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60df2t f32 quantization error rms amplitude -61.1582 dB

    Bell 200Hz, time domain error 200Hz bell, 48kHz samperate

    The input test signal: is the sum of sin waves 20, 200, 2000, 20000 hz with the frequency, with an additional sin wave added at the cutoff frequency of the filter, the time of the input signal is 0.5 seconds.

    The processed signal is subtracted in the time domain from the "perfect" output calculated at 100 bits using the gnu gmp library.

    0 5000 10 000 15 000 20 000

    -1.0

    -0.5

    0.0

    0.5

    1.0

    svf f1000 HidealL processed signal

    0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0svf f32 time domain error

    SVF-vs-DF1.nb 5

  • 0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0lad f32 time domain error

    0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0dwf f32 time domain error

    0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0dwf2 f32 time domain error

    0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0df2t f32 time domain error

    6 SVF-vs-DF1.nb

  • 0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0df1 f32 time domain error

    Bell 200Hz, quantization error spectrum 200Hz 2Q 12dB bell, 48 kHz samplerate

    The same setup as above but the fft is taken and the sin signals notched out. The rms amplitude of the spectrum is shown in the title.

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60svf f32 quantization error rms amplitude -108.788 dB

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60lad f32 quantization error rms amplitude -109.062 dB

    SVF-vs-DF1.nb 7

  • 0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60dwf f32 quantization error rms amplitude -84.8398 dB

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60dwf2 f32 quantization error rms amplitude -84.9802 dB

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60df1 f32 quantization error rms amplitude -71.0946 dB

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60df2t f32 quantization error rms amplitude -71.2432 dB

    Bell 2kHz, time domain error 2kHz bell, 48kHz samperate

    8 SVF-vs-DF1.nb

  • Bell 2kHz, time domain error 2kHz bell, 48kHz samperate

    The input test signal: is the sum of sin waves 20, 200, 2000, 20000 hz with the frequency, with an additional sin wave added at the cutoff frequency of the filter, the time of the input signal is 0.5 seconds.

    The processed signal is subtracted in the time domain from the "perfect" output calculated at 100 bits using the gnu gmp library.

    0 5000 10 000 15 000 20 000-1.0

    -0.5

    0.0

    0.5

    1.0

    svf f1000 HidealL processed signal

    0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0svf f32 time domain error

    0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0lad f32 time domain error

    SVF-vs-DF1.nb 9

  • 0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0dwf f32 time domain error

    0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0dwf2 f32 time domain error

    0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0df2t f32 time domain error

    0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0df1 f32 time domain error

    Bell 2kHz, quantization error spectrum 2kHz 2Q 12dB bell, 48kHz samplerate

    10 SVF-vs-DF1.nb

  • Bell 2kHz, quantization error spectrum 2kHz 2Q 12dB bell, 48kHz samplerate

    The same setup as above but the fft is taken and the sin signals notched out. The rms amplitude of the spectrum is shown in the title.

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60svf f32 quantization error rms amplitude -115.418 dB

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60lad f32 quantization error rms amplitude -111.536 dB

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60dwf f32 quantization error rms amplitude -101.975 dB

    SVF-vs-DF1.nb 11

  • 0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60dwf2 f32 quantization error rms amplitude -101.395 dB

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60df1 f32 quantization error rms amplitude -95.4446 dB

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60df2t f32 quantization error rms amplitude -95.1652 dB

    12 SVF-vs-DF1.nb

  • Bell 20kHz, time domain error 20kHz bell, 48kHz samperate

    The processed signal is subtracted in the time domain from the "perfect" output calculated at 100 bits using the gnu gmp library.

    0 5000 10 000 15 000 20 000

    -1.0

    -0.5

    0.0

    0.5

    1.0

    svf f1000 HidealL processed signal

    0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0svf f32 time domain error

    0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0lad f32 time domain error

    SVF-vs-DF1.nb 13

  • 0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0dwf f32 time domain error

    0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0dwf2 f32 time domain error

    0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0df2t f32 time domain error

    0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0df1 f32 time domain error

    Bell 20kHz, quantization error spectrum 20kHz 2Q 12dB bell, 48kHz samplerate

    14 SVF-vs-DF1.nb

  • Bell 20kHz, quantization error spectrum 20kHz 2Q 12dB bell, 48kHz samplerate

    The same setup as above but the fft is taken and the sin signals notched out. The rms amplitude of the spectrum is shown in the title.

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60svf f32 quantization error rms amplitude -108.266 dB

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60lad f32 quantization error rms amplitude -115.351 dB

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60dwf f32 quantization error rms amplitude -105.077 dB

    SVF-vs-DF1.nb 15

  • 0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60dwf2 f32 quantization error rms amplitude -104.292 dB

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60df1 f32 quantization error rms amplitude -103.902 dB

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60df2t f32 quantization error rms amplitude -104.774 dB

    16 SVF-vs-DF1.nb

  • Bell Sweep, time domain error 20Hz-20kHz sweep 2Q 12dB bell, 48kHz samperate

    This time the cutoff is swept over 0.5 seconds from 20 Hz to 20 kHz. The processed signal is subtracted in the time domain from the "perfect" output calculated at 100 bits using the gnu gmp library, where the modulation of the current and previous time coefficients is taken into account.

    0 5000 10 000 15 000 20 000

    -0.6

    -0.4

    -0.2

    0.0

    0.2

    0.4

    0.6

    svf f1000 HidealL processed signal

    0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0svf f32 time domain error

    0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0lad f32 time domain error

    SVF-vs-DF1.nb 17

  • 0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0dwf f32 time domain error

    0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0dwf2 f32 time domain error

    0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0df2t f32 time domain error

    0 5000 10 000 15 000 20 000-120

    -100

    -80

    -60

    -40

    -20

    0df1 f32 time domain error

    Bell Sweep, quantization error speectrum 20Hz-20kHz sweep 2Q 12dB bell, 48kHz samplerate

    18 SVF-vs-DF1.nb

  • Bell Sweep, quantization error speectrum 20Hz-20kHz sweep 2Q 12dB bell, 48kHz samplerate

    The same setup as above but the fft is taken and the sin signals notched out. The rms amplitude of the spectrum is shown in the title.

    0 5000 10 000 15 000 20 000

    -150

    -100

    -50

    0svf f32 quantization error rms amplitude -117.946 dB

    0 5000 10 000 15 000 20 000

    -150

    -100

    -50

    0lad f32 quantization error rms amplitude -95.5856 dB

    0 5000 10 000 15 000 20 000

    -150

    -100

    -50

    0dwf f32 quantization error rms amplitude -66.91 dB

    SVF-vs-DF1.nb 19

  • 0 5000 10 000 15 000 20 000

    -150

    -100

    -50

    0dwf2 f32 quantization error rms amplitude -67.0619 dB

    0 5000 10 000 15 000 20 000

    -150

    -100

    -50

    0df1 f32 quantization error rms amplitude -91.6103 dB

    0 5000 10 000 15 000 20 000

    -150

    -100

    -50

    0df2t f32 quantization error rms amplitude -91.6289 dB

    20 SVF-vs-DF1.nb

  • Notch 50Hz, time domain error, 50Hz notch, 48kHz samperate, input signal 50Hz sin

    The input test signal: is the a sin wave 20Hz the time of the input signal is 0.5 seconds.

    Out[494]=

    0 5000 10 000 15 000 20 000-0.1

    0.0

    0.1

    0.2

    0.3

    0.4

    0.5

    svf f1000 HidealL processed signal

    Out[496]=

    0 5000 10 000 15 000 20 000-140

    -120

    -100

    -80

    -60

    -40

    -20

    0svf f1000 HidealL processed signal dB

    Out[497]=

    0 5000 10 000 15 000 20 000-140

    -120

    -100

    -80

    -60

    -40

    -20

    0svf f32 dB

    SVF-vs-DF1.nb 21

  • Out[498]=

    0 5000 10 000 15 000 20 000-140

    -120

    -100

    -80

    -60

    -40

    -20

    0lad f32 dB

    Out[499]=

    0 5000 10 000 15 000 20 000-140

    -120

    -100

    -80

    -60

    -40

    -20

    0dwf f32 dB

    Out[500]=

    0 5000 10 000 15 000 20 000-140

    -120

    -100

    -80

    -60

    -40

    -20

    0dwf2 f32 dB

    Out[501]=

    0 5000 10 000 15 000 20 000-140

    -120

    -100

    -80

    -60

    -40

    -20

    0df2t f32 dB

    22 SVF-vs-DF1.nb

  • Out[502]=

    0 5000 10 000 15 000 20 000-140

    -120

    -100

    -80

    -60

    -40

    -20

    0df1 f32 dB

    Notch 50Hz, spectrum of 50Hz notch, 48kHz samplerate, input signal 50Hz sin

    The input test signal: is the a sin wave 20Hz the time of the input signal is 1.0 seconds, but the first 5000 samples are discarded to allow the notch to settle into is maximum attenuation

    Out[509]=

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60svf f32 quantization error rms amplitude -104.967 dB

    Out[511]=

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60lad f32 quantization error rms amplitude -32.4966 dB

    SVF-vs-DF1.nb 23

  • Out[513]=

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60dwf f32 quantization error rms amplitude -44.764 dB

    Out[515]=

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60dwf2 f32 quantization error rms amplitude -44.7498 dB

    Out[517]=

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60df1 f32 quantization error rms amplitude -39.185 dB

    Out[519]=

    0 5000 10 000 15 000 20 000-180

    -160

    -140

    -120

    -100

    -80

    -60df2t f32 quantization error rms amplitude -33.1381 dB

    24 SVF-vs-DF1.nb