Hi,
Why does the following function use unsigned types (uint16_t and uint32_t) for data that is copied into the buffer, when the buffer (as declared in the header file) uses the signed int16_t type?
I understand that the second half of the 32 bit value would hold the imaginary part of the input data, but I don't see why any unsigned types are used in this function. Also, this applies to the 256 point FFT code as well.
Why does the following function use unsigned types (uint16_t and uint32_t) for data that is copied into the buffer, when the buffer (as declared in the header file) uses the signed int16_t type?
Code:
// 140312 - PAH - slightly faster copy
static void copy_to_fft_buffer(void *destination, const void *source)
{
const uint16_t *src = (const uint16_t *)source;
uint32_t *dst = (uint32_t *)destination;
for (int i=0; i < AUDIO_BLOCK_SAMPLES; i++) {
*dst++ = *src++; // real sample plus a zero for imaginary
}
}
I understand that the second half of the 32 bit value would hold the imaginary part of the input data, but I don't see why any unsigned types are used in this function. Also, this applies to the 256 point FFT code as well.