Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // How annoying the VinnieFalco filters deal with the number of channels as a template parameter :-/
- template<typename FiltType>
- inline std::shared_ptr<Dsp::Filter> create_filter(int numchans, int smoothlen=512)
- {
- if (numchans==1)
- return std::make_shared<Dsp::SmoothedFilterDesign<FiltType, 1>>(smoothlen);
- if (numchans==2)
- return std::make_shared<Dsp::SmoothedFilterDesign<FiltType, 2>>(smoothlen);
- if (numchans==3)
- return std::make_shared<Dsp::SmoothedFilterDesign<FiltType, 3>>(smoothlen);
- if (numchans==4)
- return std::make_shared<Dsp::SmoothedFilterDesign<FiltType, 4>>(smoothlen);
- // **ck it for other channel counts, let's just say 8 is enough
- return std::make_shared<Dsp::SmoothedFilterDesign<FiltType, 8>>(smoothlen);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement