Hi, Matkat Music, thanks for the question. Since in the filtering function we don't do any memory management, std::vector would be an unnecessary detail. However, if you look into the source code I linked to, you will see that these raw array pointers are initialized with std::vector::data() so they use vectors under the hood :)
Hello! Does it make any sense to write it in assembly? Will we have any increase in performance or will this task be too complex and difficult?I mean standard x64 architecture - a usual laptop (not DSP or MCU)
Interesting that you used the sound response of a room to somehow make the music match. I think this needs a more generalised explanation because most non DSP mathematicians won't have understood IMO :)
Damn, that's a pretty crazy result for such a simple filter. I am a bit puzzled how we get from the impulse response to the coefficient list (dsp noob here), but will look into your code to figure out those details.
So, after a bit of thinking, are the coefficients just the magnitudes of each sample of that audio wave? Because an impulse is only 1 sample, all the other sound we hear is a result of convolution, w decaying size over time. Ok, little eye opener over here.
It's so bizarre and extremely fascinating how delay, reverberation and filtering are all one and the same thing. Makes sense in one way, twists around my head in the other.
@@bigmistqke The coefficients are calculated by multiplying the ideal impulse response of the filter with a windowing function. The textbook DSP A practical Approach by E C. Ifeachor and B. W. Jerwis has a nice examples if you are interested.
@@danmiller4091 thanks for answering my question! I am glossing over it right now, this dsp-literature is quite dense lol. But if i understand it correctly, this multiplying the audio-file of the impulse response by the windowing function is because we are interested in the energy of the signal, right? Makes sense, as it turns the waveform into how the volume changes over time, and that's what the coefficients are. And then from this generated buffer we would take sample #0 and this would be a(0), sample #1 a(1), ..., sample #n a(n)? I assume this is what they describe in the book as the 'direct method'.
So the coefficients are just a reversed impulse response with some zero padding for the ease of implementation ;) If we want to use an impulse response of a room as a filter, we don't have to preprocess it :) Windowing is only used when we design the filter in the frequency domain. Thanks for your feedback; my videos are here exactly to make the DSP literature more approachable!
Have I helped you with this video? If yes, please, consider buying me a ☕ coffee at www.buymeacoffee.com/janwilczek
Thanks! 🙂
Good shit bro! I needed to get re-upped on my convolution and you provided GREAT easy to understand (from an engineers perspective) content.
That's great, I'm happy to hear that!
Thanks for putting this up! Great help😊
Thanks! Can you do an IIR tutorial as well?
Why not use std::vector instead of raw C-style arrays?
Hi, Matkat Music, thanks for the question. Since in the filtering function we don't do any memory management, std::vector would be an unnecessary detail. However, if you look into the source code I linked to, you will see that these raw array pointers are initialized with std::vector::data() so they use vectors under the hood :)
for up-to-date cpp, std::span would be better idea.
@@wrongitstea Sigh...another reason why there should only be C and Assembly programming languages.
Hello! Does it make any sense to write it in assembly? Will we have any increase in performance or will this task be too complex and difficult?I mean standard x64 architecture - a usual laptop (not DSP or MCU)
very thorough explanation, thanks 👍 I wish you well in your marketing agenda (it is much more complex than FIN Filter in C++ I presume 🤣)
If I wanted to create an FIR low pass filter at a specific frequency how could I change this code to implement a desired corner frequency?
This was fantastic, thank you. 😀
Great to hear that, thanks!
Interesting that you used the sound response of a room to somehow make the music match. I think this needs a more generalised explanation because most non DSP mathematicians won't have understood IMO :)
Can you explain Hilbert transform in c++ too?
Noted, will try! Thanks! 🙂
How are u implementing sound with the code please can I know this is not domain i am intrested please any one ???
Super helpful video thank you very much!!
Awesome to hear that!
Nice look with this shirt 🙃
Thanks!
Useful 👍
Thanks, great to hear!
Also it is a fundamental filter for Video coding ;)
Yes, of course! And I want to leave talking about image and video FIR filters to more knowledgeable people :)
Damn, that's a pretty crazy result for such a simple filter. I am a bit puzzled how we get from the impulse response to the coefficient list (dsp noob here), but will look into your code to figure out those details.
So, after a bit of thinking, are the coefficients just the magnitudes of each sample of that audio wave? Because an impulse is only 1 sample, all the other sound we hear is a result of convolution, w decaying size over time. Ok, little eye opener over here.
It's so bizarre and extremely fascinating how delay, reverberation and filtering are all one and the same thing. Makes sense in one way, twists around my head in the other.
@@bigmistqke The coefficients are calculated by multiplying the ideal impulse response of the filter with a windowing function. The textbook DSP A practical Approach by E C. Ifeachor and B. W. Jerwis has a nice examples if you are interested.
@@danmiller4091 thanks for answering my question! I am glossing over it right now, this dsp-literature is quite dense lol. But if i understand it correctly, this multiplying the audio-file of the impulse response by the windowing function is because we are interested in the energy of the signal, right? Makes sense, as it turns the waveform into how the volume changes over time, and that's what the coefficients are. And then from this generated buffer we would take sample #0 and this would be a(0), sample #1 a(1), ..., sample #n a(n)? I assume this is what they describe in the book as the 'direct method'.
So the coefficients are just a reversed impulse response with some zero padding for the ease of implementation ;) If we want to use an impulse response of a room as a filter, we don't have to preprocess it :) Windowing is only used when we design the filter in the frequency domain. Thanks for your feedback; my videos are here exactly to make the DSP literature more approachable!
6:58 I thought you were playing Nokia ringtone