Fixed Pass Through. Initial Issue of AudioFilterConvolution_F32

pull/13/head
boblark 3 years ago
parent 675f5283ca
commit 4861603cf8
  1. 3
      AudioFilterConvolution_F32.cpp
  2. 8
      examples/TestConvolutinalFilter/TestConvolutinalFilter.ino

@ -78,9 +78,8 @@ void AudioFilterConvolution_F32::update(void)
k++; k++;
l++; l++;
} }
// convert floats to Q15 and save in temporary array tbuffer
arm_copy_f32 (&buffer[0], &tbuffer[0], BUFFER_SIZE*4);
} }
arm_copy_f32 (&buffer[0], &tbuffer[0], BUFFER_SIZE*4);
bp = block->data; bp = block->data;
for (int i = 0; i < AUDIO_BLOCK_SAMPLES; i++) { for (int i = 0; i < AUDIO_BLOCK_SAMPLES; i++) {
buffer[i] = *bp; buffer[i] = *bp;

@ -49,7 +49,7 @@ void setup(void) {
// *** Un-comment just ONE of the following filters *** // *** Un-comment just ONE of the following filters ***
// Low Pass Filter, 4000 Hz cut off, 60 dB first sidelobe // Low Pass Filter, 4000 Hz cut off, 60 dB first sidelobe
convFilt1.initFilter(4000.0f, 60.0f, LOWPASS, 0.0f); //convFilt1.initFilter(4000.0f, 60.0f, LOWPASS, 0.0f);
// High Pass Filter, 2000 Hz cut off, 25 dB first sidelobe // High Pass Filter, 2000 Hz cut off, 25 dB first sidelobe
//convFilt1.initFilter(2000.0f, 25.0f, HIGHPASS, 0.0f); //convFilt1.initFilter(2000.0f, 25.0f, HIGHPASS, 0.0f);
@ -85,6 +85,10 @@ void setup(void) {
convFilt1.initFilter(); // Generate the filter mask convFilt1.initFilter(); // Generate the filter mask
*/ */
// Alternatively, the passthrough case:
convFilt1.passThrough(1);
convFilt1.initFilter();
// Design for direct FIR. This sets frequency response. // Design for direct FIR. This sets frequency response.
// Bin for 4kHz at 44.117kHz sample rate and 400 coeff's is (4000/44117) * (512/2) = 23.2 // Bin for 4kHz at 44.117kHz sample rate and 400 coeff's is (4000/44117) * (512/2) = 23.2
// for(int ii=0; ii<47; ii++) attenFIR[ii] = 0.0f; // for(int ii=0; ii<47; ii++) attenFIR[ii] = 0.0f;
@ -108,7 +112,7 @@ void setup(void) {
Serial.print(f); Serial.print(f);
Serial.print(", "); Serial.print(", ");
while(!toneDet2.available())delay(2) ; while(!toneDet2.available())delay(2) ;
Serial.println(20.0f*log10f(toneDet2.read() ) ); Serial.println(20.0f*log10f(toneDet2.read()), 3);
} }
} }

Loading…
Cancel
Save