Pārlūkot izejas kodu

Document FIR filter requirements, fixes #114

dds
PaulStoffregen pirms 9 gadiem
vecāks
revīzija
29b4ded50d
3 mainītis faili ar 18 papildinājumiem un 3 dzēšanām
  1. +1
    -1
      examples/Effects/Filter_FIR/Filter_FIR.ino
  2. +5
    -2
      filter_fir.h
  3. +12
    -0
      gui/index.html

+ 1
- 1
examples/Effects/Filter_FIR/Filter_FIR.ino Parādīt failu



struct fir_filter { struct fir_filter {
short *coeffs; short *coeffs;
short num_coeffs;
short num_coeffs; // num_coeffs must be an even number, 4 or higher
}; };


// index of current filter. Start with the low pass. // index of current filter. Start with the low pass.

+ 5
- 2
filter_fir.h Parādīt failu

coeff_p = cp; coeff_p = cp;
// Initialize FIR instance (ARM DSP Math Library) // Initialize FIR instance (ARM DSP Math Library)
if (coeff_p && (coeff_p != FIR_PASSTHRU) && n_coeffs <= FIR_MAX_COEFFS) { if (coeff_p && (coeff_p != FIR_PASSTHRU) && n_coeffs <= FIR_MAX_COEFFS) {
arm_fir_init_q15(&fir_inst, n_coeffs, (q15_t *)coeff_p,
&StateQ15[0], AUDIO_BLOCK_SAMPLES);
if (arm_fir_init_q15(&fir_inst, n_coeffs, (q15_t *)coeff_p,
&StateQ15[0], AUDIO_BLOCK_SAMPLES) != ARM_MATH_SUCCESS) {
// n_coeffs must be an even number, 4 or larger
coeff_p = NULL;
}
} }
} }
void end(void) { void end(void) {

+ 12
- 0
gui/index.html Parādīt failu

<h3>Examples</h3> <h3>Examples</h3>
<p class=exam>File &gt; Examples &gt; Audio &gt; Effects &gt; Filter_FIR <p class=exam>File &gt; Examples &gt; Audio &gt; Effects &gt; Filter_FIR
</p> </p>
<h3>Known Issues</h3>
<p>Your filter's impulse response array must have an even length. If you have
add odd number of taps, you must add an extra zero to increase the length
to an even number.
</p>
<p>The minimum number of taps is 4. If you use less, add extra zeros to increase
the length to 4.
</p>
<p>The impulse response must be given in reverse order. Many filters have
symetrical impluse response, making this a non-issue. If your filter has
a non-symetrical response, make sure the data is in reverse time order.
</p>
<h3>Notes</h3> <h3>Notes</h3>
<p>FIR filters requires more CPU time than Biquad (IIR), but they can <p>FIR filters requires more CPU time than Biquad (IIR), but they can
implement filters with better phase response. implement filters with better phase response.

Notiek ielāde…
Atcelt
Saglabāt