Helpful ReplyFilter math

Author
The Maillard Reaction
Max Output Level: 0 dBFS
  • Total Posts : 31918
  • Joined: 2004/07/09 20:02:20
  • Status: offline
2014/02/17 10:52:55 (permalink)

Filter math

drewfx1 recently pointed out that FIR and IIR filters both have benefits, and that each can be applied to suit different priorities.
 
I went to study up and found this video helpful:
 



#1
cclarry
Max Output Level: 0 dBFS
  • Total Posts : 20964
  • Joined: 2012/02/07 09:42:07
  • Status: offline
Re: Filter math 2014/02/17 11:30:26 (permalink)
Thanx Mike! Will watch this after all my other "stuff" is done!


#2
dmbaer
Max Output Level: -49.5 dBFS
  • Total Posts : 2585
  • Joined: 2008/08/04 20:10:22
  • Location: Concord CA
  • Status: offline
Re: Filter math 2014/02/17 17:20:21 (permalink)
mike_mccue
 
I went to study up and found this video helpful:
 



Mike, if you truly understood this video tutorial, then I'm duly impressed.  When I was studying engineering in college, I frequently encountered the kind of math involved in DSP calculations (although I never directly studied DSP itself).  However, that ship sailed a long time ago.  This stuff isn't for the faint of mind.
 
#3
wst3
Max Output Level: -55.5 dBFS
  • Total Posts : 1979
  • Joined: 2003/11/04 10:28:11
  • Location: Pottstown, PA 19464
  • Status: offline
Re: Filter math 2014/02/17 18:54:38 (permalink)
That's a pretty cool video! FIR vs IIR filters have been the subject of debate (intense debate) within the live sound community for the last couple of years. Almost every DSP device (think BSS, Biamp, Symetrix, MediaMatrix, etc) offers both, and the latency can now  be reduced to near manageable levels. Among other things, this makes it possible to create some really hairy - I mean complex) cross-over networks... cross-overs being one of the weak points in most multi-way sound reinforcement systems.

There are a couple other resources you might enjoy - I have to find out if they are freely sharable, but if they are I will post them here.

Not sure what hardware/software you have at your disposal - but if you get the chance try creating the same filter in both topologies and see if you can hear a difference!

-- Bill
Audio Enterprise
KB3KJF
#4
The Maillard Reaction
Max Output Level: 0 dBFS
  • Total Posts : 31918
  • Joined: 2004/07/09 20:02:20
  • Status: offline
Re: Filter math 2014/02/17 20:43:28 (permalink)
dmbaer
mike_mccue
 
I went to study up and found this video helpful:
 



Mike, if you truly understood this video tutorial, then I'm duly impressed.  When I was studying engineering in college, I frequently encountered the kind of math involved in DSP calculations (although I never directly studied DSP itself).  However, that ship sailed a long time ago.  This stuff isn't for the faint of mind.
 




Hi David,
 I don't think "truly understand" applies for me, but I did find that I was able to follow the explanation as the overview it seemed it was meant to be, and I felt like I understood more at the end than I did at the beginning.
 
 I was especially interested in the idea that FIR refers to a data table, that so called Linear Phase EQs are FIR, and that the reference to a large data table can cause lots of loading. It made me think of the infamous LP64 EQ and all its glitches.
 
 I'd like to follow some examples of IIR where the variables are replaced with actual numbers so I can get a better understanding of what goes on.
 
 best regards,
mike


#5
drewfx1
Max Output Level: -9.5 dBFS
  • Total Posts : 6585
  • Joined: 2008/08/04 16:19:11
  • Status: offline
Re: Filter math 2014/02/18 11:56:43 (permalink)
mike_mccue 
 I'd like to follow some examples of IIR where the variables are replaced with actual numbers so I can get a better understanding of what goes on.
 



What goes on is if you take any set of coefficients and a feed a single sample with a value of "1" surrounded by silence and do the math you get the impulse response.

 In order, then, to discover the limit of deepest tones, it is necessary not only to produce very violent agitations in the air but to give these the form of simple pendular vibrations. - Hermann von Helmholtz, predicting the role of the electric bassist in 1877.
#6
bapu
Max Output Level: 0 dBFS
  • Total Posts : 86000
  • Joined: 2006/11/25 21:23:28
  • Location: Thousand Oaks, CA
  • Status: offline
Re: Filter math 2014/02/18 12:59:36 (permalink) ☄ Helpfulby mike_mccue 2014/02/18 21:21:12
drewfx1
mike_mccue 
 I'd like to follow some examples of IIR where the variables are replaced with actual numbers so I can get a better understanding of what goes on.
 



What goes on is if you take any set of coefficients and a feed a single sample with a value of "1" surrounded by silence and do the math you get the impulse response.


+1
(see watt I did there?)
#7
The Maillard Reaction
Max Output Level: 0 dBFS
  • Total Posts : 31918
  • Joined: 2004/07/09 20:02:20
  • Status: offline
Re: Filter math 2014/02/18 21:21:47 (permalink)
drewfx1
mike_mccue 
 I'd like to follow some examples of IIR where the variables are replaced with actual numbers so I can get a better understanding of what goes on.
 



What goes on is if you take any set of coefficients and a feed a single sample with a value of "1" surrounded by silence and do the math you get the impulse response.




It seems like seeing first hand how a series of samples go in one side and come out the other with a 1 octave wide boost at 5kHz would be something that would help with furthering an understanding.
 
best regards,
mike


#8
drewfx1
Max Output Level: -9.5 dBFS
  • Total Posts : 6585
  • Joined: 2008/08/04 16:19:11
  • Status: offline
Re: Filter math 2014/02/19 00:34:10 (permalink)
mike_mccue
It seems like seeing first hand how a series of samples go in one side and come out the other with a 1 octave wide boost at 5kHz would be something that would help with furthering an understanding.
 



That's exactly what the impulse response shows you.
 
A single sample impulse input to the filter contains all frequencies with flat response and the impulse response output by the filter contains the filtered response. You have a series of filter coefficients that produce a given impulse response. The impulse response completely defines what the filter does in the time domain - it equates to the frequency and phase response of the filter in the frequency domain. 
 
The filter coefficients define either an FIR or an IIR filter and you just have a series of single sample delays, multiply the delayed samples by each associated coefficient and add each result back to your signal (with an IIR some of the coefficients feed back as well). IOW, the basic structure of the filter is either FIR or IIR, but is otherwise the same regardless of what the filter is actually doing - what changes is the coefficients.
 
The tricky part is getting the filter coefficients that produce the desired results. 

 In order, then, to discover the limit of deepest tones, it is necessary not only to produce very violent agitations in the air but to give these the form of simple pendular vibrations. - Hermann von Helmholtz, predicting the role of the electric bassist in 1877.
#9
The Maillard Reaction
Max Output Level: 0 dBFS
  • Total Posts : 31918
  • Joined: 2004/07/09 20:02:20
  • Status: offline
Re: Filter math 2014/02/19 07:10:44 (permalink)
Yes, I'd like to see a specific example with a impulse response that is described as something I can relate to and with an input that is described as something I can relate to.
 
The video showed some filters, but I have no idea what they were.
 
You mentioned an input of "1" surrounded by silence, and I can not readily imagine what that an input of 1 sounds like.
 
I think it might be interesting to see a specific example where a input, perhaps a G chord "pad" voiced on a Hammond B3 went in and came out the other side.
 
Perhaps what I am missing is that I don't actually need to recognize the input to see the "filter", but at the very least it would seem like the knowing what the filter is supposed to be doing, in some specific example, might be a good next step.
 
I have seen transfer functions for analog EQ design but the little bit I know about them hasn't prepared me to recognize how/what/if Impulse Response techniques are similar or different.
 
best regards,
mike 


#10
drewfx1
Max Output Level: -9.5 dBFS
  • Total Posts : 6585
  • Joined: 2008/08/04 16:19:11
  • Status: offline
Re: Filter math 2014/02/19 11:43:09 (permalink)
What you're going to see if you do that Mike is exactly what you see now if you just look at any waveform before and after you put it through a filter. Do you really want to go through multiplying each sample by each coefficient and adding them together? IMO, it's going to be very tedious and not very enlightening.
 
 
But you can think about it this way - filters work by "remembering" the previous samples (the capacitor does this in the analog world) and using phase shift.
 
Consider that at a given sampling frequency there is a phase difference between adjacent samples based on the relationship between the frequency of the signal and the sampling frequency. At low frequencies the phase shift is very small - 0° at 0Hz (aka DC) and 180° at the Nyquist frequency (exactly 1/2 the sampling rate = exactly 2 samples per cycle = 180° phase difference).
 
So basically what is happening is you are phase shifting your original signal with the single sample delays, multiplying the signal that has been phase shifted by the appropriate coefficients, and then adding the result back into the original signal. This will either add or cancel at a given frequency, and to varying degrees depending on the amount of phase shift at a given frequency and the value of the coefficient (including whether it's positive or negative).

 In order, then, to discover the limit of deepest tones, it is necessary not only to produce very violent agitations in the air but to give these the form of simple pendular vibrations. - Hermann von Helmholtz, predicting the role of the electric bassist in 1877.
#11
bitflipper
01100010 01101001 01110100 01100110 01101100 01101
  • Total Posts : 26036
  • Joined: 2006/09/17 11:23:23
  • Location: Everett, WA USA
  • Status: offline
Re: Filter math 2014/02/20 15:35:06 (permalink)
You guys and your Science stuff!
 
Our good friend Danny D has said that there's no room in music for science, an opinion often echoed on such authoritative sources as Gearslutz.
 
You haven't yet addressed the pixie-dust coefficient, the factor that makes one equalizer sound better than the others. 
 
 
BTW, for those reading this thread with a big cartoon question-mark hovering over their head, one of the best simplified explanations I've come across is in Mr Aldrich's book, required reading for anyone dipping their toes into the technical side of things generally.


All else is in doubt, so this is the truth I cling to. 

My Stuff
#12
dmbaer
Max Output Level: -49.5 dBFS
  • Total Posts : 2585
  • Joined: 2008/08/04 20:10:22
  • Location: Concord CA
  • Status: offline
Re: Filter math 2014/02/20 16:19:14 (permalink)
bitflipper
 
BTW, for those reading this thread with a big cartoon question-mark hovering over their head, one of the best simplified explanations I've come across is in Mr Aldrich's book, required reading for anyone dipping their toes into the technical side of things generally.



Er ... thanks, Bit ... I guess.  Damn Amazon and it's insidious "buy with one click"!
#13
drewfx1
Max Output Level: -9.5 dBFS
  • Total Posts : 6585
  • Joined: 2008/08/04 16:19:11
  • Status: offline
Re: Filter math 2014/02/20 17:00:51 (permalink)
bitflipper
You guys and your Science stuff!
 
Our good friend Danny D has said that there's no room in music for science, an opinion often echoed on such authoritative sources as Gearslutz.

 
That's OK - sometimes I think there's no room in science for musicians either (present company excepted). 
 

You haven't yet addressed the pixie-dust coefficient, the factor that makes one equalizer sound better than the others. 



If you use a complex number (a + bi) for the coefficient, b equals the pixie-dust part.

 In order, then, to discover the limit of deepest tones, it is necessary not only to produce very violent agitations in the air but to give these the form of simple pendular vibrations. - Hermann von Helmholtz, predicting the role of the electric bassist in 1877.
#14
bitflipper
01100010 01101001 01110100 01100110 01101100 01101
  • Total Posts : 26036
  • Joined: 2006/09/17 11:23:23
  • Location: Everett, WA USA
  • Status: offline
Re: Filter math 2014/02/21 13:23:35 (permalink)
You're so good with explanations, Drew! Maybe next you could address what makes a compressor "musical". 
 
 
 


All else is in doubt, so this is the truth I cling to. 

My Stuff
#15
drewfx1
Max Output Level: -9.5 dBFS
  • Total Posts : 6585
  • Joined: 2008/08/04 16:19:11
  • Status: offline
Re: Filter math 2014/02/21 15:36:48 (permalink)
I recommend putting compressors through a thorough course of musical study:


 In order, then, to discover the limit of deepest tones, it is necessary not only to produce very violent agitations in the air but to give these the form of simple pendular vibrations. - Hermann von Helmholtz, predicting the role of the electric bassist in 1877.
#16
Jump to:
© 2024 APG vNext Commercial Version 5.1