Rational_resampler vs pfb_arb_resampler filter design -- why such strange cut frequencies in both ca

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

I’m looking at filter design procedures for rational_resampler and
pfb_arb_ resampler and see contradiction between them.

Lets assume downsample with rate 3/4 or 0.75. Lets source sample rate
to be 10000 (so, target sample rate should be 7500), but, in fact, it
is irrelevant.

rational_resampler could be configured for this task with
interpolation=3 and decimation=4. We’ll set fractional_bw to “0.4” to
match arb_resampler “80%” multiplier. design_filter() method in
rational_resample.py will create low-pass filter with:

gain = 3
FS = 1
transition center = 0.4/3 = 0,1(3) of 30000 = 4000 (!!!)
transition width = 0.1

It doesn’t look resonable, as 4000 is more than 3750 which is Nyquist
frequency for targer sampling rate.

Lets look at arbitrary resampler (pfb.py):

rate is < 1. so it takes first branch:

gain = 32 (default number of filters)
FS = 32 (WHY?!)
transition center = 0.5 * 0.75 * 0.8 = 0.3 (And it should be in Hz!)
transition width = 0.15

As you can see, parameters are rather different. But in this case
filter should be roughly the same, because task is the same! We need
to filter out all frequencies below 3750!

And both methods raise the questions. I could not say, that one of
the methods looks good to me. Questions are:

(1) Why rational resampler doesn’t take decimation in account when
calculates bandwidth? It design filter which will correctly reject all
images in upsample, but looks like aliasing is possibly when effective
ratio is less than 1, as only interpolation is used in bandwidth
calculation and resulting filter “effectively” works at upsampled rate.

(2) Why arbitrary resampler set Fs to number of filters and AFTER
that pass bandwidth numbers as normalized to 1, not to this Fs?! 0.3
is perfectly good (may be slighly conservative, but Ok) transition
band center, but in this case this 0.3 will be taken for FS=1, and
here FS=32 (number of filters) is used, so it will be 32 times too low
(!).

Are these two peculiarities two bugs, really, or I don’t understand
something?

Yes, I’ve read harris’ book on multirating processing, and AFTER this
book I got these questions.


Black Lion AKA Lev Serebryakov
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQJ8BAEBCgBmBQJUSCQDXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRGOTZEMUNBMEI1RjQzMThCNjc0QjMzMEFF
QUIwM0M1OEJGREM0NzhGAAoJEOqwPFi/3EePRzAP/1BERw1W6GM+kLwYDEulshRu
fzUcoa7+MWuK/Bn5lVmLl0DnoAUT+4jOpQaQhh581P3KTXMBGffooLoLPAfo6TRj
J+8wdtbTa+8biVY2+Cug6yD2Sdo/mXOqMI2w74amaBr6HrzI2r9aDjuTX26E6FZd
HAL7lL7QSqfbSRMfnRFTZTtjmPOatK7Z310j9TKirv7QG6Ko9KLk/po9TdgOUQgP
/ddOi1mRxCvGdVE8e0M5rDvGwd+ToTqfgf7jo7RQcDdmftzsfjmGPVrSyPLED/v1
86cVFWeHjOJ/HmZ797dGc6Bv3nX89J0TTneIL0m4J65qskqukquCYvD17OIB+kL3
wXfOBumpssVbAA1wjoPyDXOlXKO9GIhcMm6XosXpw+wJnHSx1ykx3Ycd3uew8/Cm
9fYIdqRmYoxh1hlHvpvri1iJslMQqz7bHWYw0aEPYCE6KY8tV004Nen2prH5Wdyy
3mkn7g/kQfnGHL9EPhYdyGUJBG4MnGPsCW6FF2SPRZkReK+cgVDA8WBt5YExQayP
nFr3F9atnuD8LxJ697zIeNJAbK4CBofaiEw4wZ2ooWqG52MIdq1ArqIqEC3P2dK1
xqjt/IPbZaiXTykjAqH8zWcPX1BsJnGLdvhhofLGdkLRQD/x+3nmEiDIH9PFTCfW
D6U1vL56df3r+FRgMczz
=4Rwb
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On 23.10.2014 01:39, Lev Serebryakov wrote:

I’m looking at filter design procedures for rational_resampler and
pfb_arb_ resampler and see contradiction between them.
So, no comments?


// Black Lion AKA Lev Serebryakov
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (MingW32)

iQJ8BAEBCgBmBQJUTns3XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRGOTZEMUNBMEI1RjQzMThCNjc0QjMzMEFF
QUIwM0M1OEJGREM0NzhGAAoJEOqwPFi/3EePOi8QAJvf8e/SwTeGCGAa5u12pnfK
tvCCqEhIcJdSJ31unMe893V3k2B/LaP7Zrpyr38g1ml0oJEOgJxQIJLFdB4OumVr
oLMmPXeQfq3QRDN9fk1Q5QqUEb55VoFhXdbBfne+qKTXclyIfPXznkbtnp8zT7Mm
AyXIZoLyQDpPQX56wCjxuHwzL+uz6nMtlKF5W/1hFzluiMJV5v9H/IHWA/OU1cVS
UXQGCCADUOYk6L86cxQkI9a+9tag3WALPM0AufTyWO8p8WflGZWYjUqBjLcEnxU6
4j0w8tpTEXC1arxXbl2qd64zXe+Y6PhrMidV5SejLRsd1WYrJ0ULLj55QB1RPOkZ
+wrmiVm4A0ZEIpG59XlmNOsTltGjK5QuKjV1WOpjZJP9LBF2i/Yndu1HPqTBCslt
oP7XPA5f8p9x7mfD+IPLUV6Em1GgXlkipmhAuU5fvozNK5PZfgSrZd6Y1s1W3cEy
Nh1PHSpX8l5aLAhqruWKb12TUIIH9Oky1XV72FMCUhWDW81l9391EVzOVwGFoLLW
O5ZL4p8vZU9sAV9/s8YsZjpNJ5PTzTddY5yH4JjN7SyP371l7pKeF8APnt7+sXPR
F1grY00k/Wo1Tj0XS6UlIChhNYcwh4ulN11kbreIhVJRl10fUjDRVixAJy4/Vhg1
87F+jAjKfOSVRpJZiOYD
=pbxp
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On 23.10.2014 01:39, Lev Serebryakov wrote:

(1) Why rational resampler doesn’t take decimation in account when
calculates bandwidth? It design filter which will correctly reject
all images in upsample, but looks like aliasing is possibly when
effective ratio is less than 1, as only interpolation is used in
bandwidth calculation and resulting filter “effectively” works at
upsampled rate.
Here I’m right, according to other thread.

(2) Why arbitrary resampler set Fs to number of filters and AFTER
that pass bandwidth numbers as normalized to 1, not to this Fs?!
0.3 is perfectly good (may be slighly conservative, but Ok)
transition band center, but in this case this 0.3 will be taken for
FS=1, and here FS=32 (number of filters) is used, so it will be 32
times too low (!).
And here I’mn wrong, and code is right, as filter effectively work
and “higher” frequency and all frequencies should be properly scaled.


// Black Lion AKA Lev Serebryakov
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (MingW32)

iQJ8BAEBCgBmBQJUT4WZXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRGOTZEMUNBMEI1RjQzMThCNjc0QjMzMEFF
QUIwM0M1OEJGREM0NzhGAAoJEOqwPFi/3EePvfAQAIljuBr95qllFCA49uBqTtjQ
sZq9bCrTR+gYfrNgPEb10GO/8981cmN+4eJFEiJRPVf9g5I1uSqa0vDiqPuyDXCQ
DQIxbsvGi+F82FpWEZRm3OWuoYHoY/MNm+T8evkOL+LKG4Fo7ohgFghDnZ6csaY/
0h0BLFUkBV9cGW2Havy0RWR5QZoRQnc9ATwUdYuVY7HeIbFKET3E+IJp36yC82lc
yyMRfneCTvHuMC59M4OO138ZmXkL4h+OptdQKd094IVNlpMEJyw0q+XQFukSj/RD
t+gx3tPNgW9uII7syUYk11ASmZc17NcFQEdSoEIuRNdhkp3UzEeCSUMrRk1DN+ki
HiZcMDJ4rWXhKv7hJ8QIhcvQOmHxjnqV0izjir6YChIKbibp8pSRajoL2jRm5726
MoezAPmG5jmAuqaw0nacXgIZCombMWNS7KQkn901VKBDypGpRCdS/GUi7bvmOhB/
PEEvL51grQ6pCXgUnnJ2rYlEKmBlPxIU8CAmGxUW5oEWnr2TLnFc9X27bFiTsS0I
y2pLqhCOzaCzKxL+Et0mZM/7eof932DNnoesjqw/VBGDlDZPPc8+svlwHn7KjiVY
Go3AcqUzIfVED1MkZGs9wgWzaQJX7bS9jdQPy5mhJfcs5/cUdN4BWV0VLcq2yeew
wjVJtxt1ReS3OaXy7bDX
=hyaw
-----END PGP SIGNATURE-----