On Wed, Mar 1, 2017 at 9:24 PM, Muhammad Faiz <mfc...@gmail.com> wrote: > this gives better frequency response > > Signed-off-by: Muhammad Faiz <mfc...@gmail.com> > --- > libswresample/resample.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) >
Test case, from 44100 to 705600 (16*44100) ffmpeg -filter_complex "aevalsrc='if(n-300,0,1)', aresample=osr=705600:filter_size=16" -f f32le - | ./freq-resp > freq-resp.txt
#include <stdio.h> #include <math.h> #include <libavcodec/avfft.h> #define BITS 16 #define OSR 705600 #define ISR 44100 #define LENGTH (1 << BITS) int main(int argc, char **argv) { static FFTComplex buf[LENGTH]; int k; FFTContext *fft = av_fft_init(BITS, 0); for (k = 0; k < LENGTH; k++) fread(buf+k, sizeof(float), 1, stdin); av_fft_permute(fft, buf); av_fft_calc(fft, buf); for (k = 0; k <= LENGTH/2; k++) printf("%.17f %.17f\n", (double) k * OSR / LENGTH, 20.0 * log10(hypot(buf[k].re, buf[k].im) * ISR / OSR)); return 0; }
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel