@ -234,31 +234,27 @@ static void resampler_fft_decimate(srsran_resampler_fft_t* q, const cf_t* input,
while ( count < nsamples ) {
while ( count < nsamples ) {
uint32_t n = SRSRAN_MIN ( q - > window_sz , nsamples - count ) ;
uint32_t n = SRSRAN_MIN ( q - > window_sz , nsamples - count ) ;
if ( input ) {
// Copy input samples
// Copy input samples
srsran_vec_cf_copy ( q - > in_buffer , & input [ count ] , n ) ;
srsran_vec_cf_copy ( q - > in_buffer , & input [ count ] , n ) ;
// Pad zeroes
srsran_vec_cf_zero ( & q - > in_buffer [ n ] , q - > fft . size - n ) ;
// Execute FFT
// Pad zeroes
srsran_dft_run_guru_c ( & q - > fft ) ;
srsran_vec_cf_zero ( & q - > in_buffer [ n ] , q - > fft . size - n ) ;
// Apply filter
// Execute FFT
srsran_vec_prod_ccc ( q - > out_buffer , q - > filter , q - > out_buffer , q - > fft . size ) ;
srsran_dft_run_guru_c ( & q - > fft ) ;
// Decimate
// Apply filter
srsran_vec_cf_copy ( q - > in_buffer , q - > out_buffer , q - > ifft . size ) ;
srsran_vec_prod_ccc ( q - > out_buffer , q - > filter , q - > out_buffer , q - > fft . size ) ;
for ( uint32_t i = 1 ; i < q - > ratio ; i + + ) {
srsran_vec_sum_ccc ( & q - > out_buffer [ q - > ifft . size * i ] , q - > in_buffer , q - > in_buffer , q - > ifft . size ) ;
}
// Execute iFFT
// Decimate
srsran_dft_run_guru_c ( & q - > ifft ) ;
srsran_vec_cf_copy ( q - > in_buffer , q - > out_buffer , q - > ifft . size ) ;
} else {
for ( uint32_t i = 1 ; i < q - > ratio ; i + + ) {
srsran_vec_ cf_zero( q - > out _buffer, q - > ifft . size ) ;
srsran_vec_ sum_ccc( & q - > out_buffer [ q - > ifft . size * i ] , q - > in_buffer , q - > in _buffer, q - > ifft . size ) ;
}
}
// Execute iFFT
srsran_dft_run_guru_c ( & q - > ifft ) ;
// Add previous state
// Add previous state
srsran_vec_sum_ccc ( q - > out_buffer , q - > state , q - > out_buffer , q - > state_len ) ;
srsran_vec_sum_ccc ( q - > out_buffer , q - > state , q - > out_buffer , q - > state_len ) ;