@@ -50,6 +50,98 @@ template <typename CoeffType>
5050class FilterDesigner
5151{
5252public:
53+ // ==============================================================================
54+ // FIR Filter Design
55+ // ==============================================================================
56+
57+ /* *
58+ Designs FIR lowpass filter coefficients using windowing method.
59+
60+ @param coeffs Pre-allocated vector to store coefficients (size determines filter length)
61+ @param cutoff The cutoff frequency in Hz
62+ @param sampleRate The sample rate in Hz
63+ @param windowType The window function to use
64+ @param parameter Window parameter (Kaiser beta, Gaussian sigma, etc.)
65+ */
66+ static void designFirLowpass (
67+ std::vector<CoeffType>& coeffs,
68+ CoeffType cutoff,
69+ double sampleRate,
70+ WindowType windowType = WindowType::kaiser,
71+ CoeffType parameter = static_cast <CoeffType> (6.0 )
72+ ) noexcept
73+ {
74+ designFIRLowpassImpl (coeffs, cutoff, sampleRate);
75+ WindowFunctions<CoeffType>::applyWindow (windowType, coeffs, parameter);
76+ }
77+
78+ /* *
79+ Designs FIR highpass filter coefficients using windowing method.
80+
81+ @param coeffs Pre-allocated vector to store coefficients (size determines filter length)
82+ @param cutoff The cutoff frequency in Hz
83+ @param sampleRate The sample rate in Hz
84+ @param windowType The window function to use
85+ @param parameter Window parameter (Kaiser beta, Gaussian sigma, etc.)
86+ */
87+ static void designFirHighpass (
88+ std::vector<CoeffType>& coeffs,
89+ CoeffType cutoff,
90+ double sampleRate,
91+ WindowType windowType = WindowType::kaiser,
92+ CoeffType parameter = static_cast <CoeffType> (6.0 )
93+ ) noexcept
94+ {
95+ designFIRHighpassImpl (coeffs, cutoff, sampleRate);
96+ WindowFunctions<CoeffType>::applyWindow (windowType, coeffs, parameter);
97+ }
98+
99+ /* *
100+ Designs FIR bandpass filter coefficients using windowing method.
101+
102+ @param coeffs Pre-allocated vector to store coefficients (size determines filter length)
103+ @param lowCutoff The low cutoff frequency in Hz
104+ @param highCutoff The high cutoff frequency in Hz
105+ @param sampleRate The sample rate in Hz
106+ @param windowType The window function to use
107+ @param parameter Window parameter (Kaiser beta, Gaussian sigma, etc.)
108+ */
109+ static void designFirBandpass (
110+ std::vector<CoeffType>& coeffs,
111+ CoeffType lowCutoff,
112+ CoeffType highCutoff,
113+ double sampleRate,
114+ WindowType windowType = WindowType::kaiser,
115+ CoeffType parameter = static_cast <CoeffType> (6.0 )
116+ ) noexcept
117+ {
118+ designFIRBandpassImpl (coeffs, lowCutoff, highCutoff, sampleRate);
119+ WindowFunctions<CoeffType>::applyWindow (windowType, coeffs, parameter);
120+ }
121+
122+ /* *
123+ Designs FIR bandstop filter coefficients using windowing method.
124+
125+ @param coeffs Pre-allocated vector to store coefficients (size determines filter length)
126+ @param lowCutoff The low cutoff frequency in Hz
127+ @param highCutoff The high cutoff frequency in Hz
128+ @param sampleRate The sample rate in Hz
129+ @param windowType The window function to use
130+ @param parameter Window parameter (Kaiser beta, Gaussian sigma, etc.)
131+ */
132+ static void designFirBandstop (
133+ std::vector<CoeffType>& coeffs,
134+ CoeffType lowCutoff,
135+ CoeffType highCutoff,
136+ double sampleRate,
137+ WindowType windowType = WindowType::kaiser,
138+ CoeffType parameter = static_cast <CoeffType> (6.0 )
139+ ) noexcept
140+ {
141+ designFIRBandstopImpl (coeffs, lowCutoff, highCutoff, sampleRate);
142+ WindowFunctions<CoeffType>::applyWindow (windowType, coeffs, parameter);
143+ }
144+
53145 // ==============================================================================
54146 // Butterworth Filter Design
55147 // ==============================================================================
@@ -422,98 +514,6 @@ class FilterDesigner
422514 }
423515#endif
424516
425- // ==============================================================================
426- // FIR Filter Design
427- // ==============================================================================
428-
429- /* *
430- Designs FIR lowpass filter coefficients using windowing method.
431-
432- @param coeffs Pre-allocated vector to store coefficients (size determines filter length)
433- @param cutoff The cutoff frequency in Hz
434- @param sampleRate The sample rate in Hz
435- @param windowType The window function to use
436- @param parameter Window parameter (Kaiser beta, Gaussian sigma, etc.)
437- */
438- static void designFirLowpass (
439- std::vector<CoeffType>& coeffs,
440- CoeffType cutoff,
441- double sampleRate,
442- WindowType windowType = WindowType::kaiser,
443- CoeffType parameter = static_cast <CoeffType> (6.0 )
444- ) noexcept
445- {
446- designFIRLowpassImpl (coeffs, cutoff, sampleRate);
447- WindowFunctions<CoeffType>::applyWindow (windowType, coeffs, parameter);
448- }
449-
450- /* *
451- Designs FIR highpass filter coefficients using windowing method.
452-
453- @param coeffs Pre-allocated vector to store coefficients (size determines filter length)
454- @param cutoff The cutoff frequency in Hz
455- @param sampleRate The sample rate in Hz
456- @param windowType The window function to use
457- @param parameter Window parameter (Kaiser beta, Gaussian sigma, etc.)
458- */
459- static void designFirHighpass (
460- std::vector<CoeffType>& coeffs,
461- CoeffType cutoff,
462- double sampleRate,
463- WindowType windowType = WindowType::kaiser,
464- CoeffType parameter = static_cast <CoeffType> (6.0 )
465- ) noexcept
466- {
467- designFIRHighpassImpl (coeffs, cutoff, sampleRate);
468- WindowFunctions<CoeffType>::applyWindow (windowType, coeffs, parameter);
469- }
470-
471- /* *
472- Designs FIR bandpass filter coefficients using windowing method.
473-
474- @param coeffs Pre-allocated vector to store coefficients (size determines filter length)
475- @param lowCutoff The low cutoff frequency in Hz
476- @param highCutoff The high cutoff frequency in Hz
477- @param sampleRate The sample rate in Hz
478- @param windowType The window function to use
479- @param parameter Window parameter (Kaiser beta, Gaussian sigma, etc.)
480- */
481- static void designFirBandpass (
482- std::vector<CoeffType>& coeffs,
483- CoeffType lowCutoff,
484- CoeffType highCutoff,
485- double sampleRate,
486- WindowType windowType = WindowType::kaiser,
487- CoeffType parameter = static_cast <CoeffType> (6.0 )
488- ) noexcept
489- {
490- designFIRBandpassImpl (coeffs, lowCutoff, highCutoff, sampleRate);
491- WindowFunctions<CoeffType>::applyWindow (windowType, coeffs, parameter);
492- }
493-
494- /* *
495- Designs FIR bandstop filter coefficients using windowing method.
496-
497- @param coeffs Pre-allocated vector to store coefficients (size determines filter length)
498- @param lowCutoff The low cutoff frequency in Hz
499- @param highCutoff The high cutoff frequency in Hz
500- @param sampleRate The sample rate in Hz
501- @param windowType The window function to use
502- @param parameter Window parameter (Kaiser beta, Gaussian sigma, etc.)
503- */
504- static void designFirBandstop (
505- std::vector<CoeffType>& coeffs,
506- CoeffType lowCutoff,
507- CoeffType highCutoff,
508- double sampleRate,
509- WindowType windowType = WindowType::kaiser,
510- CoeffType parameter = static_cast <CoeffType> (6.0 )
511- ) noexcept
512- {
513- designFIRBandstopImpl (coeffs, lowCutoff, highCutoff, sampleRate);
514- WindowFunctions<CoeffType>::applyWindow (windowType, coeffs, parameter);
515- }
516-
517517 // ==============================================================================
518518 // RBJ (Audio EQ Cookbook) Filter Design
519519 // ==============================================================================
0 commit comments