Browse Source

Merge pull request #23 from el-supremo/master

Fix #20
dds
Paul Stoffregen 11 years ago
parent
commit
db3d4801e9
2 changed files with 8 additions and 9 deletions
  1. +4
    -5
      analyze_fft256.cpp
  2. +4
    -4
      filter_fir.cpp

+ 4
- 5
analyze_fft256.cpp View File

@@ -40,15 +40,14 @@ void AudioAnalyzeFFT256::init(void)
//outputflag = false;
}

// 140312 - PAH - slightly faster copy
static void copy_to_fft_buffer(void *destination, const void *source)
{
const int16_t *src = (const int16_t *)source;
int16_t *dst = (int16_t *)destination;
const uint16_t *src = (const uint16_t *)source;
uint32_t *dst = (uint32_t *)destination;

// TODO: optimize this
for (int i=0; i < AUDIO_BLOCK_SAMPLES; i++) {
*dst++ = *src++; // real
*dst++ = 0; // imaginary
*dst++ = *src++; // real sample plus a zero for imaginary
}
}


+ 4
- 4
filter_fir.cpp View File

@@ -50,12 +50,12 @@ void AudioFilterFIR::update(void)
// do passthru
if(coeff_p == FIR_PASSTHRU) {
// Just passthrough
block = receiveWritable(0);
block = receiveReadOnly(0);
if(block) {
transmit(block,0);
release(block);
}
block = receiveWritable(1);
block = receiveReadOnly(1);
if(block) {
transmit(block,1);
release(block);
@@ -63,7 +63,7 @@ void AudioFilterFIR::update(void)
return;
}
// Left Channel
block = receiveWritable(0);
block = receiveReadOnly(0);
// get a block for the FIR output
b_new = allocate();
if(block && b_new) {
@@ -75,7 +75,7 @@ void AudioFilterFIR::update(void)
if(b_new)release(b_new);

// Right Channel
block = receiveWritable(1);
block = receiveReadOnly(1);
b_new = allocate();
if(block && b_new) {
arm_fir_q15(&r_fir_inst, (q15_t *)block->data, (q15_t *)b_new->data, AUDIO_BLOCK_SAMPLES);

Loading…
Cancel
Save