fix for amplification factor for resampler
This commit is contained in:
parent
f5feef2a6f
commit
c9e70f5cb0
2 changed files with 116 additions and 116 deletions
|
@ -21,128 +21,128 @@
|
|||
|
||||
// Filter for ratio 2
|
||||
static float fResTaps2[INTERP_I_2 * DECIM_D_2 * NUM_TAPS_PER_PHASE2] = {
|
||||
-0.00543278438387929850f,
|
||||
-0.04267524016158903000f,
|
||||
0.20891570602538878000f,
|
||||
0.83952404734744124000f,
|
||||
0.83952404734744124000f,
|
||||
0.20891570602538878000f,
|
||||
-0.04267524016158903000f,
|
||||
-0.00543278438387929850f
|
||||
-0.00384155867856543230f,
|
||||
-0.03017595170702409800f,
|
||||
0.14772571242692767000f,
|
||||
0.59363314684855195000f,
|
||||
0.59363314684855195000f,
|
||||
0.14772571242692767000f,
|
||||
-0.03017595170702409800f,
|
||||
-0.00384155867856543230f
|
||||
};
|
||||
|
||||
|
||||
// Filter for ratio 3 / 2
|
||||
static float fResTaps3_2[INTERP_I_3_2 * DECIM_D_3_2 * NUM_TAPS_PER_PHASE3_2] = {
|
||||
-0.00408852062433148060f,
|
||||
-0.03403350863992425000f,
|
||||
-0.04022975217253792900f,
|
||||
0.13329249686943762000f,
|
||||
0.53708476977179720000f,
|
||||
0.91181435690712065000f,
|
||||
0.91181435690712065000f,
|
||||
0.53708476977179720000f,
|
||||
0.13329249686943762000f,
|
||||
-0.04022975217253792900f,
|
||||
-0.03403350863992425000f,
|
||||
-0.00408852062433148060f
|
||||
-0.00236050848304511720f,
|
||||
-0.01964925537472771800f,
|
||||
-0.02322665824624670800f,
|
||||
0.07695645894852715100f,
|
||||
0.31008603640539528000f,
|
||||
0.52643626441129154000f,
|
||||
0.52643626441129154000f,
|
||||
0.31008603640539528000f,
|
||||
0.07695645894852715100f,
|
||||
-0.02322665824624670800f,
|
||||
-0.01964925537472771800f,
|
||||
-0.00236050848304511720f
|
||||
};
|
||||
|
||||
|
||||
// Filter for ratio 12 / 7
|
||||
static float fResTaps12_7[INTERP_I_12_7 * DECIM_D_12_7 * NUM_TAPS_PER_PHASE12_7] = {
|
||||
-0.00185134160992586720f,
|
||||
-0.00535053051492332800f,
|
||||
-0.01104625703005996000f,
|
||||
-0.01899767406878452600f,
|
||||
-0.02882121807019974400f,
|
||||
-0.03958235672293213700f,
|
||||
-0.04974153780519474000f,
|
||||
-0.05717451684296728800f,
|
||||
-0.05927956058301216100f,
|
||||
-0.05317329279983799100f,
|
||||
-0.03596445360838258800f,
|
||||
-0.00508228090027591780f,
|
||||
0.04137452990390712300f,
|
||||
0.10430949713686680000f,
|
||||
0.18336405182544557000f,
|
||||
0.27675710732757719000f,
|
||||
0.38125907488903715000f,
|
||||
0.49231678134249329000f,
|
||||
0.60432839502202396000f,
|
||||
0.71104906219027497000f,
|
||||
0.80609094024529682000f,
|
||||
0.88346804514451582000f,
|
||||
0.93812874014341641000f,
|
||||
0.96641799077360369000f,
|
||||
0.96641799077360369000f,
|
||||
0.93812874014341641000f,
|
||||
0.88346804514451582000f,
|
||||
0.80609094024529682000f,
|
||||
0.71104906219027497000f,
|
||||
0.60432839502202396000f,
|
||||
0.49231678134249329000f,
|
||||
0.38125907488903715000f,
|
||||
0.27675710732757719000f,
|
||||
0.18336405182544557000f,
|
||||
0.10430949713686680000f,
|
||||
0.04137452990390712300f,
|
||||
-0.00508228090027591780f,
|
||||
-0.03596445360838258800f,
|
||||
-0.05317329279983799100f,
|
||||
-0.05927956058301216100f,
|
||||
-0.05717451684296728800f,
|
||||
-0.04974153780519474000f,
|
||||
-0.03958235672293213700f,
|
||||
-0.02882121807019974400f,
|
||||
-0.01899767406878452600f,
|
||||
-0.01104625703005996000f,
|
||||
-0.00535053051492332800f,
|
||||
-0.00185134160992586720f
|
||||
-0.00053443628842632721f,
|
||||
-0.00154456511654914500f,
|
||||
-0.00318877973492145670f,
|
||||
-0.00548415611879476010f,
|
||||
-0.00831996900560136310f,
|
||||
-0.01142644215457233100f,
|
||||
-0.01435914512086756300f,
|
||||
-0.01650486134503697700f,
|
||||
-0.01711253513002239700f,
|
||||
-0.01534980745584262400f,
|
||||
-0.01038204348602874600f,
|
||||
-0.00146712812293579720f,
|
||||
0.01194379798880749800f,
|
||||
0.03011155812550227500f,
|
||||
0.05293264234056074100f,
|
||||
0.07989289520785943000f,
|
||||
0.11006001475908662000f,
|
||||
0.14211961311732932000f,
|
||||
0.17445458077244999000f,
|
||||
0.20526218373129310000f,
|
||||
0.23269841067097030000f,
|
||||
0.25503525684230932000f,
|
||||
0.27081444032816293000f,
|
||||
0.27898084356141867000f,
|
||||
0.27898084356141867000f,
|
||||
0.27081444032816293000f,
|
||||
0.25503525684230932000f,
|
||||
0.23269841067097030000f,
|
||||
0.20526218373129310000f,
|
||||
0.17445458077244999000f,
|
||||
0.14211961311732932000f,
|
||||
0.11006001475908662000f,
|
||||
0.07989289520785943000f,
|
||||
0.05293264234056074100f,
|
||||
0.03011155812550227500f,
|
||||
0.01194379798880749800f,
|
||||
-0.00146712812293579720f,
|
||||
-0.01038204348602874600f,
|
||||
-0.01534980745584262400f,
|
||||
-0.01711253513002239700f,
|
||||
-0.01650486134503697700f,
|
||||
-0.01435914512086756300f,
|
||||
-0.01142644215457233100f,
|
||||
-0.00831996900560136310f,
|
||||
-0.00548415611879476010f,
|
||||
-0.00318877973492145670f,
|
||||
-0.00154456511654914500f,
|
||||
-0.00053443628842632721f
|
||||
};
|
||||
|
||||
// Filter for ratios close to 1
|
||||
static float fResTaps1[INTERP_DECIM_I_D1 * NUM_TAPS_PER_PHASE1] = {
|
||||
-0.00200330615661920140f,
|
||||
-0.00657158284969252320f,
|
||||
-0.01434325067267541500f,
|
||||
-0.02515649349164660000f,
|
||||
-0.03781954301370460400f,
|
||||
-0.04991380271447259900f,
|
||||
-0.05780029046175797600f,
|
||||
-0.05688089663877354800f,
|
||||
-0.04212153837626786400f,
|
||||
-0.00879070792017156400f,
|
||||
0.04668529656863164300f,
|
||||
0.12588850452342773000f,
|
||||
0.22775132810044491000f,
|
||||
0.34821676223650200000f,
|
||||
0.48031735951868820000f,
|
||||
0.61470848494637820000f,
|
||||
0.74061377477860824000f,
|
||||
0.84706508415438742000f,
|
||||
0.92426036786924715000f,
|
||||
0.96483311873999922000f,
|
||||
0.96483311873999922000f,
|
||||
0.92426036786924715000f,
|
||||
0.84706508415438742000f,
|
||||
0.74061377477860824000f,
|
||||
0.61470848494637820000f,
|
||||
0.48031735951868820000f,
|
||||
0.34821676223650200000f,
|
||||
0.22775132810044491000f,
|
||||
0.12588850452342773000f,
|
||||
0.04668529656863164300f,
|
||||
-0.00879070792017156400f,
|
||||
-0.04212153837626786400f,
|
||||
-0.05688089663877354800f,
|
||||
-0.05780029046175797600f,
|
||||
-0.04991380271447259900f,
|
||||
-0.03781954301370460400f,
|
||||
-0.02515649349164660000f,
|
||||
-0.01434325067267541500f,
|
||||
-0.00657158284969252320f,
|
||||
-0.00200330615661920140f
|
||||
-0.00063350103055546773f,
|
||||
-0.00207811696375283240f,
|
||||
-0.00453573411763965540f,
|
||||
-0.00795518173768052820f,
|
||||
-0.01195958959900151800f,
|
||||
-0.01578413032580285000f,
|
||||
-0.01827805672784607200f,
|
||||
-0.01798731887311402800f,
|
||||
-0.01331999998191969400f,
|
||||
-0.00277986592730237800f,
|
||||
0.01476318703973193400f,
|
||||
0.03980944055264415400f,
|
||||
0.07202129369257158400f,
|
||||
0.11011580881166547000f,
|
||||
0.15188968557970114000f,
|
||||
0.19438789094618825000f,
|
||||
0.23420263947953687000f,
|
||||
0.26786549923300679000f,
|
||||
0.29227679134919288000f,
|
||||
0.30510702171820847000f,
|
||||
0.30510702171820847000f,
|
||||
0.29227679134919288000f,
|
||||
0.26786549923300679000f,
|
||||
0.23420263947953687000f,
|
||||
0.19438789094618825000f,
|
||||
0.15188968557970114000f,
|
||||
0.11011580881166547000f,
|
||||
0.07202129369257158400f,
|
||||
0.03980944055264415400f,
|
||||
0.01476318703973193400f,
|
||||
-0.00277986592730237800f,
|
||||
-0.01331999998191969400f,
|
||||
-0.01798731887311402800f,
|
||||
-0.01827805672784607200f,
|
||||
-0.01578413032580285000f,
|
||||
-0.01195958959900151800f,
|
||||
-0.00795518173768052820f,
|
||||
-0.00453573411763965540f,
|
||||
-0.00207811696375283240f,
|
||||
-0.00063350103055546773f
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
%/******************************************************************************\
|
||||
% * Copyright (c) 2004-2006
|
||||
% * Copyright (c) 2004-2009
|
||||
% *
|
||||
% * Author(s):
|
||||
% * Volker Fischer
|
||||
|
@ -9,12 +9,12 @@
|
|||
function resamplefilter()
|
||||
|
||||
% Number of taps per poly phase for different resampling types
|
||||
GlobalNoTaps = 4;%12; % use global value for all types
|
||||
GlobalNoTaps = 4; % use global value for all types
|
||||
|
||||
NoTapsP2 = GlobalNoTaps; % 24 kHz
|
||||
NoTapsP3_2 = GlobalNoTaps; % 32 kHz
|
||||
NoTapsP12_7 = GlobalNoTaps; % 28 kHz
|
||||
NoTapsP1 = GlobalNoTaps; % 48 kHz
|
||||
NoTapsP2 = GlobalNoTaps; % 24 kHz
|
||||
NoTapsP3_2 = GlobalNoTaps; % 32 kHz
|
||||
NoTapsP12_7 = GlobalNoTaps; % 28 kHz
|
||||
NoTapsP1 = GlobalNoTaps; % 48 kHz
|
||||
|
||||
|
||||
% Filter for ratio 2 -----------------------------------------------------------
|
||||
|
@ -116,7 +116,7 @@ fclose(fid);
|
|||
return;
|
||||
|
||||
|
||||
function [h] = DesignFilter(NoTapsPIn, I)
|
||||
function h = DesignFilter(NoTapsPIn, I)
|
||||
|
||||
% number of taps, consider interpolation factor
|
||||
NoTapsP = NoTapsPIn * I;
|
||||
|
@ -125,7 +125,7 @@ NoTapsP = NoTapsPIn * I;
|
|||
fc = 0.97 / I;
|
||||
|
||||
% MMSE filter design with Kaiser window, consider interpolation factor
|
||||
h = I * firls(NoTapsP - 1, [0 fc fc 1], [1 1 0 0]) .* kaiser(NoTapsP, 5)';
|
||||
h = sqrt(I) * firls(NoTapsP - 1, [0 fc fc 1], [1 1 0 0]) .* kaiser(NoTapsP, 5)';
|
||||
|
||||
return;
|
||||
|
||||
|
|
Loading…
Reference in a new issue