Which class/method has that chance to later set the number of channels to process? Sorry, it might be something obvious I've missed so far. (Even then, there might be some additional resource usage if the template parameter is set to, say 32 channels, but only 1 or 2 channels are later used...?)thevinn wrote:The intent is that you set the template argument to the MAX number of channels you might want to process and then pass a smaller number later with the actual number of channels to process.Xenakios wrote:I wanted the code to dynamically adjust the channel count at runtime. But now, of course the number of channels used by the library is a template parameter, so you might see what that lead into...
A Collection of Useful C++ Classes for Signal Processing
-
- KVRian
- 1270 posts since 9 Sep, 2005 from Oulu, Finland
- KVRian
- Topic Starter
- 775 posts since 30 Nov, 2008
I'm not really sure, I am still studying this mess to try to figure out what I was thinking. I'm contemplating rewriting it to use the standard library a bit more, no reason why the number of channels can't be determined at run time, and use classes like `vector` and what not.
My Open Source:
Beast, rippled, DSPFilters, LayerEffects, SimpleDJ
Beast, rippled, DSPFilters, LayerEffects, SimpleDJ
-
- KVRian
- 1194 posts since 28 May, 2010 from Finland
-
- KVRian
- 1379 posts since 26 Apr, 2004 from UK
Get the coefficients parameters and Python/Matlab 
-
- KVRian
- 1194 posts since 28 May, 2010 from Finland
But the lib actually does them, since the Demo has the bode plots.Miles1981 wrote:Get the coefficients parameters and Python/Matlab
I'm also seeing some call to m_Filter->response, which I take to return the transfer function or something. What I was asking was someone to perhaps clarify, how it should be done.
-
- KVRer
- 1 posts since 19 Aug, 2015
AUTO-ADMIN: Non-MP3, WAV, OGG, SoundCloud, YouTube, Vimeo, Twitter and Facebook links in this post have been protected automatically. Once the member reaches 5 posts the links will function as normal.
Hi, I am getting weird results from some filters.
I have tested the following filter design:
Code: Select all (#)
Dsp::SimpleFilter<Dsp::Butterworth::HighPass<1>, 1> filter_;
filter_.setup(1, 23.0, 0.1);
double* channels [1];
channels[0] = &impulseSignal[0];
filter_.process(impulseSignal.size(), channels);
Code: Select all (#)
std::vector<double> impulseSignal = {
0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0, 0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
};Code: Select all (#)
std::vector<double> firstImpulseResponse = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.986524132,
-0.026588539,-0.025871931,-0.025174638,-0.024496138,-0.023835924,
-0.023193505,-0.022568399,-0.021960142,-0.021368278,-0.020792366,
-0.020231975,-0.019686688,-0.019156098,-0.018639808,-0.018137433,
-0.017648597,-0.017172937,-0.016710097,-0.01625973,-0.015821502,-0.015395086,
-0.014980161,-0.01457642,-0.01418356,-0.013801288,-0.01342932,-0.013067376,
-0.012715188,-0.012372491,-0.012039031,-0.011714558,-0.011398831,-0.011091612,
-0.010792674,-0.010501793,-0.010218751,-0.009943338,-0.009675348,-0.009414581,
-0.009160841,-0.008913941,-0.008673695,-0.008439923,-0.008212453,-0.007991113,
-0.007775739,-0.007566169,-0.007362248,-0.007163822,-0.006970745,-0.006782871,
-0.006600061,-0.006422178,-0.006249089,-0.006080665,-0.005916781,-0.005757313,
-0.005602144,-0.005451156,-0.005304238,-0.00516128,-0.005022174,-0.004886818,
-0.00475511,-0.004626951,-0.004502247, -0.004380903,-0.00426283,-0.00414794,
-0.004036146,-0.003927364,-0.003821515,-0.003718519,-0.003618298
};
Code: Select all (#)
9.86524e-09
-1.01311e-08
9.87241e-09
-1.01242e-08
9.87919e-09
-1.01176e-08
9.88562e-09
-1.01113e-08
9.8917e-09
-1.01054e-08
9.89746e-09
-1.00998e-08
9.90291e-09
-1.00945e-08
9.90807e-09
-1.00894e-08
9.91296e-09
-1.00847e-08
9.91759e-09
-1.00802e-08
9.92197e-09
-1.00759e-08
9.92612e-09
-1.00719e-08
-0.986524
0.0265885
0.0258719
0.0251746
0.0244961
0.0238359
0.0231935
0.0225684
0.0219602
0.0213683
0.0207924
0.020232
0.0196867
0.0191561
0.0186398
0.0181374
0.0176486
0.0171729
0.0167101
0.0162597
0.0158215
0.0153951
0.0149802
0.0145764
0.0141836
0.0138013
0.0134293
0.0130674
0.0127152
0.0123725
0.012039
0.0117145
0.0113988
0.0110916
0.0107927
0.0105018
0.0102188
0.00994333
0.00967536
0.00941457
0.00916085
0.00891393
0.0086737
0.00843991
0.00821246
0.0079911
0.00777575
0.00756616
0.00736226
0.00716381
0.00697075
0.00678286
0.00660007
0.00642217
0.0062491
0.00608066
0.00591679
0.0057573
0.00560215
0.00545115
0.00530425
0.00516127
0.00502218
0.00488681
0.00475512
0.00462694
0.00450226
0.00438089
0.00426284
0.00414793
0.00403616
0.00392735
0.00382153
0.00371851
0.00361831
0.00352077Any ideas?
Thanks
-
- KVRian
- 1194 posts since 28 May, 2010 from Finland
Anyone understand how would it be possible to control the gain of a filter using an envelope?
E.g. to create an LFO filter?
How do I "route" the envelope to the gain param?
Preferably I'd need to apply the modulation on a per-sample (that is 1 sample) basis.
So to call the filter param setting one sample at a time..?
E.g. to create an LFO filter?
How do I "route" the envelope to the gain param?
Preferably I'd need to apply the modulation on a per-sample (that is 1 sample) basis.
So to call the filter param setting one sample at a time..?
-
- KVRer
- 1 posts since 24 Jan, 2016
Hello!
I am newbie in DSP and don't know theory (only somethign about FFT, not about filtering). I have downloaded this library. And wanted to implement it in my application. But I get very weird results. Doesn't matter what filter I use, or what input array I pass to the filter I always get picture, where in the middle of the output array everything is ok, but numbers at the edges of the array increase rapidly. Like on attached image.
I am newbie in DSP and don't know theory (only somethign about FFT, not about filtering). I have downloaded this library. And wanted to implement it in my application. But I get very weird results. Doesn't matter what filter I use, or what input array I pass to the filter I always get picture, where in the middle of the output array everything is ok, but numbers at the edges of the array increase rapidly. Like on attached image.
You do not have the required permissions to view the files attached to this post.
-
- KVRist
- 76 posts since 7 Mar, 2011
It's a shame that this library seems to have some bugs in it.
I'm getting the "Smooth" filters shut off output, when their parameters are modulated faster than the interpolation size.
I'm getting the "Smooth" filters shut off output, when their parameters are modulated faster than the interpolation size.
-
- KVRist
- 37 posts since 18 Sep, 2011
Has anybody recognized that with Butterworth/Bessel/etc. HighPass-Filters with uneven orders the output phase is inverted (180deg)?
I fixed it with inverting the b-vars in BiquadBase::setOnePole, but its probably the wrong fix.
const double b0 = zero.real();
const double b1 = -1;
const double b2 = 0;
I fixed it with inverting the b-vars in BiquadBase::setOnePole, but its probably the wrong fix.
const double b0 = zero.real();
const double b1 = -1;
const double b2 = 0;
-
- KVRist
- 37 posts since 18 Sep, 2011
Looks like the cascaded High-Shelf & Low-Shelf filters have also phase issues with uneven order-numbers. The phase is completely shifted from low to high, even with gain=0dB.
-
- KVRist
- 37 posts since 18 Sep, 2011
After further investigation i believe the coefficient calculation in BiquadBase::setOnePole is some how wrong, maybe someone with deeper mathematical knowledge could enlighten me.
-
- KVRist
- 37 posts since 18 Sep, 2011
Wow! This fixes the low-cut and the high/low-shelf phase problem!
I'm a happy man!
viewtopic.php?f=33&t=386712
viewtopic.php?f=33&t=386712
-
- KVRist
- 76 posts since 7 Mar, 2011
Suddenly a code using this library that worked earlier is now giving me array out of bounds error.
Is this library "living" somehow, because it seems to break without touching it?
Is this library "living" somehow, because it seems to break without touching it?
-
- KVRian
- 1223 posts since 11 Aug, 2004 from France
Honestly, I think nobody should use this library anymore. There are a lot of free software around to design classic filters, such as Octave, Scilab, all the dsp python packages... And the results won't have any issue.
