A Collection of Useful C++ Classes for Signal Processing
-
- KVRer
- 22 posts since 20 Feb, 2013 from So Cal
Does this help?
http://stackoverflow.com/questions/1088 ... file-inval
http://stackoverflow.com/questions/1088 ... file-inval
-
- KVRer
- 27 posts since 9 Oct, 2014
Code: Select all
f = new Dsp::SmoothedFilterDesign <Dsp::RBJ::Design::HighPass, 2> (1024);
params[0] = SAMPLE_RATE;
params[1] = freq;
params[2] = 1.25;
f->setParams (params);
void ProcessReplacing(float** inputs, float** outputs, int nFrames)
{
...
f->process (nFrames, inputs);
...
}
Code: Select all
int remainingSamples = std::min (m_remainingSamples, numSamples);
error C2589: '(' : illegal token on right side of '::'
error C2059: syntax error : '::'
Last edited by user125 on Wed Jun 10, 2015 1:24 pm, edited 1 time in total.
-
- KVRian
- 1379 posts since 26 Apr, 2004 from UK
-
- KVRian
- 1379 posts since 26 Apr, 2004 from UK
Visual Studio? If yes, it can be that min and max are macros and not functions (older VS versions have that).
Try:
#undef min
#undef max
just before, or remove std::
edit: http://stackoverflow.com/questions/5004 ... ives-error
Try:
#undef min
#undef max
just before, or remove std::
edit: http://stackoverflow.com/questions/5004 ... ives-error
- KVRAF
- 12615 posts since 7 Dec, 2004
Don't use undef, use #define NOMINMAX before you include <windows.h>.
Alternatively, don't include <windows.h> at all because there is no reason to do so outside your dllmain or winmain function, which should be in its own source file.
The windows header also causes trouble with stdint defines and many others. In larger projects accidentally including this header leads to major issues.
Alternatively, don't include <windows.h> at all because there is no reason to do so outside your dllmain or winmain function, which should be in its own source file.
The windows header also causes trouble with stdint defines and many others. In larger projects accidentally including this header leads to major issues.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
-
julijannikolic julijannikolic https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=261510
- KVRer
- 16 posts since 27 Jul, 2011
Thanks guys! By setting "/bigobj" and "Navigate to C/C++ -> Preprocessor. Select Preprocessor Definitions and add _XKEYCHECK_H;" I was able to build it in VS2010!
-
julijannikolic julijannikolic https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=261510
- KVRer
- 16 posts since 27 Jul, 2011
Does anybody know how to actually include this library inside project? I am getting LNK2019 error in MVS2013, and don't tell me to include dsp_filters.cpp as this doesn't exist in library... 
https://github.com/vinniefalco/DSPFilters
https://github.com/vinniefalco/DSPFilters
-
- KVRer
- 22 posts since 20 Feb, 2013 from So Cal
@julijannikolic What specific problem with linking are you having? If you built it as a .lib, you would need to list it in the Linker, Additional Dependencies under your project's Properties. I simply include all of DSPFilters source code in my project, so there's no problem with finding it.
-
- KVRian
- 1194 posts since 28 May, 2010 from Finland
Is there anywhere a class similar to SimpleFilter that allows smooth parameters changes.
I think I need a class that can do switching between different filter types, but wouldn't like to write it, since someone probably has done it already.
I think I need a class that can do switching between different filter types, but wouldn't like to write it, since someone probably has done it already.
- KVRAF
- 12615 posts since 7 Dec, 2004
Switching filter types is not a simple problem to solve. Since different filter types have different phase, amplitude and group delay in many cases it is simply impossible to switch without introducing a discontinuity.
You could eliminate the zero order discontinuity although the filter state required to produce an identical output likely isn't a match to the current input signal or parameters. Due to that, you'll just end up with a 1st order or other discontinuity as the filter needs to stabilize again after the switch.
You might be best implementing a simple cross-fade.
You could eliminate the zero order discontinuity although the filter state required to produce an identical output likely isn't a match to the current input signal or parameters. Due to that, you'll just end up with a 1st order or other discontinuity as the filter needs to stabilize again after the switch.
You might be best implementing a simple cross-fade.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
-
- KVRian
- 1194 posts since 28 May, 2010 from Finland
Any idea how it's done in DSPFiltersDemo?
Can't seem to understand it.
Can't seem to understand it.
- KVRAF
- 12615 posts since 7 Dec, 2004
I can't help you there, I've never seen the code.
If for example you have filters that have equal group delay...
For example a low-pass and high-pass filter.
You can set the state of the filter to equal the last output value when switching modes and from that point it should charge to the correct position.
For example low-pass with i/o = 1, high-pass state can be set to = 1 where it will then move toward 0.
The other way, high-pass with i = 1, o = 0, low-pass state can be set to = 0 where it will move toward 1.
This will only work if the delay is equal though and it will only eliminate the zero order discontinuity. If you have a sine-wave input for example the amplitude will very quickly diverge after you've switched modes.
If you want to ensure you filter any transient of any order below some threshold you'll need to use a longer cross-fade.
If for example you have filters that have equal group delay...
For example a low-pass and high-pass filter.
You can set the state of the filter to equal the last output value when switching modes and from that point it should charge to the correct position.
For example low-pass with i/o = 1, high-pass state can be set to = 1 where it will then move toward 0.
The other way, high-pass with i = 1, o = 0, low-pass state can be set to = 0 where it will move toward 1.
This will only work if the delay is equal though and it will only eliminate the zero order discontinuity. If you have a sine-wave input for example the amplitude will very quickly diverge after you've switched modes.
If you want to ensure you filter any transient of any order below some threshold you'll need to use a longer cross-fade.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
-
- KVRian
- 1194 posts since 28 May, 2010 from Finland
Can you use the DSP::Filter::process function for numSamples = 1?
In real-time processing this is often the case that the samples are being read through one at a time, so can they be filtered one by one?
Or what would be the way to do filtering in real-time?
My use case is similar to this: http://www.kvraudio.com/forum/viewtopic ... 1#p6155174
BTW, would be helpful if there was some compilation of examples using the library. Can't seem to find many.
In real-time processing this is often the case that the samples are being read through one at a time, so can they be filtered one by one?
Or what would be the way to do filtering in real-time?
My use case is similar to this: http://www.kvraudio.com/forum/viewtopic ... 1#p6155174
BTW, would be helpful if there was some compilation of examples using the library. Can't seem to find many.
