Hi Nikhil, The type of PFB used in the casper library falls in the category of uniform critically sampled PFBs. Uniform because all the filters in the PFB (you can think of a PFB as passing your signal through a set of narrow filters at different frequencies) are derived from the same prototype low pass filter (the window function). Critically sampled because if you take the DFT of N time samples, you get one sample per every frequency, which implicitly assumes your "narrow" filters are perfect. Except in trivial cases (e.g. when the PFB is just a standard FFT), these cannot be inverted perfectly: it is not possible to find a synthesis filterbank (using Dave's terminology) that can simultaneously undo the amplitude, phase, and aliasing distortions generated by the critical sampling part of the analysis filter bank (at least not using filters of the same kind as in the PFB), even in the noiseless case.
Since this is an offline reconstruction then, as Matt Dobbs said, Jon Sievers' method is the state of the art. You may also want to check Richard Shaw's Github repo <https://github.com/jrs65/pfb-inverse/> with tools for inverting the Casper PFB. It uses the same idea as Jon's, and includes a very complete tutorial notebook. For real-time (almost perfect) reconstruction, you may want to check arXiv:2007.03171 <https://arxiv.org/pdf/2007.03171.pdf> for a practical implementation, or any of the DSP books already suggested (or this <https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=1085876> paper) for the theory part. Cheers. El vie, 4 feb 2022 a las 12:25, Nikhil Mahajan (<[email protected]>) escribió: > Hi Jon, > > This would be great to have if you are willing to share the draft. I am > fairly certain the PFB used in PUPPI is also critically-sampled and so this > work would be applicable. > > Cheers, > Nikhil > > On Fri, 4 Feb 2022 at 11:54, Jonathan Le Roy Sievers, Prof < > [email protected]> wrote: > >> Thanks for the links, Danny - I look forward to reading the papers! >> >> This discussion has reminded me that a summer student of mine worked on >> inverting critically sampled PFBs. At least for CHIME-type parameters >> (1024 channels, 4-bit quantization), he got a method working where you >> could essentially perfectly invert them with about a 3% overhead in >> bandwidth out of the F-engine. Would that be of general interest? He >> started writing up but didn't finish. >> >> Cheers, >> >> Jon >> ------------------------------ >> *From:* Danny Price <[email protected]> >> *Sent:* Friday, February 4, 2022 10:02 AM >> *To:* [email protected] <[email protected]>; Nikhil >> Mahajan <[email protected]>; Jonathan Le Roy Sievers, Prof < >> [email protected]> >> *Subject:* Re: [casper] Inverting the Polyphase Filter Bank >> >> >> Hi Nikhil, >> >> >> >> To add to Cynthia/Jon’s response on the actual inversion, the MWA is >> successfully inverting their PFB and have a few publications which detail >> it: >> >> >> >> https://ui.adsabs.harvard.edu/abs/2020JAI.....950004M/abstract >> >> https://ui.adsabs.harvard.edu/abs/2020PASA...37...34M/abstract >> >> >> >> Good luck on your PUPPI inversion quest! >> >> >> >> Cheers, >> >> Danny >> >> >> >> *From: *Hsin Cynthia Chiang, Prof <[email protected]> >> *Date: *Friday, 4 February 2022 at 10:34 pm >> *To: *[email protected] <[email protected]>, Nikhil >> Mahajan <[email protected]>, Jonathan Le Roy Sievers, Prof < >> [email protected]> >> *Subject: *Re: [casper] Inverting the Polyphase Filter Bank >> >> Hi Nikhil, >> >> >> >> I forwarded your message to Jon Sievers, who I'm cc-ing here, and I'm >> passing along a message and attachment from him. >> >> >> >> cheers, >> >> Cynthia >> >> >> >> *-------------------------------* >> >> *From:* Jonathan Le Roy Sievers, Prof <[email protected]> >> <[email protected]> >> *Sent:* Friday, February 4, 2022 9:02 AM >> *To:* [email protected] <[email protected]> >> <[email protected]> >> *Subject:* Re: [casper] Inverting the Polyphase Filter Bank >> >> >> >> Not sure if I'm allowed to post to CASPER since I'm not actually on the >> mailing list (but would be glad to be added!). Find attached a note on how >> to invert PFBs including Wiener filtering (which you absolutely will want >> if you're working with any quantization post-PFB ). Very simple python >> code, where window is the window function used in the initial PFB and >> thresh roughly the quantization noise vs PFB RMS (so ~0.1 for 4-bit data) >> is below. I do have a GPU version in case you're trying to invert huge >> quantities of data - my 3070 will invert gigasamples/second with it. >> >> >> >> def inverse_pfb_fft_filt(dat,ntap,window=pfb.sinc_hamming,thresh=0.0): >> >> dd=np.fft.irfft(dat,axis=1) >> >> win=window(ntap,dd.shape[1]) >> >> win=np.reshape(win,[ntap,len(win)//ntap]) >> >> mat=np.zeros(dd.shape,dtype=dd.dtype) >> >> mat[:ntap,:]=win >> >> matft=np.fft.rfft(mat,axis=0) >> >> ddft=np.fft.rfft(dd,axis=0) >> >> if thresh>0: >> >> filt=np.abs(matft)**2/(thresh**2+np.abs(matft)**2)*(1+thresh**2) >> >> ddft=ddft*filt >> >> return np.fft.irfft(ddft/np.conj(matft),axis=0) >> >> >> >> Cheers, >> >> >> >> Jon >> >> >> >> >> >> >> >> On 2022-02-04 00:09, Nikhil Mahajan wrote: >> >> Dear CASPERites, >> >> >> >> I am a graduate student at the University of Toronto (working with Marten >> van Kerkwijk) and I have some raw baseband data collected using PUPPI >> (Arecibo) - and I am on a quest to invert the polyphase filter bank. I have >> 32 channels of complex-baseband that I would very much like to combine into >> a single 100 MHz bandwidth stream. >> >> >> >> To do this, I would need to understand some of the specifics of the >> filter bank pipeline (so that I can successfully invert each step). This is >> my current understanding of what happened to the data I have: >> >> >> >> 1. Real-valued data sampled at 200 MS/s arrives at the Casper BEE2 board. >> >> 2. This goes through a real-input PFB implementation such as >> `pfb_fir_real` and using a 12-tap, 64-branch polyphase filter (I have the >> filter coefficients that were used here). This step outputs 64 streams of >> real-valued data. >> >> 3. Then, for the DFT step of the filterbank, the 64 real-valued streams >> are passed through the `fft_wideband_real` block to get 32 channels of >> complex-valued data. >> >> 4. This is then saved to disk. >> >> >> >> (I hope someone familiar with PUPPI can correct me here if I am wrong >> about any of the above) >> >> >> >> Step 3 is the step I am confused about. `fft_wideband_real` does not >> appear to be a conventional real-input N-point FFT implementation (Else I >> would have N/2 + 1 channels instead of just N/2). Some documentation on >> this block says that it "computes the real-sampled Fast Fourier >> Transform using the standard Hermitian conjugation trick". What is this >> standard Hermitian conjugation trick? I am totally unfamiliar with this. >> Would I be wrong in guessing it uses some sort of trick to convert 64 real >> numbers to 32 complex numbers and then applies a regular ol' complex-valued >> FFT on them? >> >> >> >> Thank you so much! I appreciate any and all guidance this mailing list >> can provide. >> >> >> >> Cheers, >> Nikhil Mahajan >> >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "[email protected]" <[email protected]> group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CAA39X0%2B3z051d%2B%2BAB0D%3D1LHNHdOSDJp6JEYzzRXatj-ij11_qA%40mail.gmail.com >> <https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CAA39X0%2B3z051d%2B%2BAB0D%3D1LHNHdOSDJp6JEYzzRXatj-ij11_qA%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "[email protected]" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/e7ea3a41-a9a3-86ff-8008-7724da4c8612%40mcgill.ca >> <https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/e7ea3a41-a9a3-86ff-8008-7724da4c8612%40mcgill.ca?utm_medium=email&utm_source=footer> >> . >> > -- > You received this message because you are subscribed to the Google Groups " > [email protected]" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CAA39X0J1RQ5Eh1xq0e2NXR0n1ejSCvvP%3D8bPsSVjckYPYJrQVg%40mail.gmail.com > <https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CAA39X0J1RQ5Eh1xq0e2NXR0n1ejSCvvP%3D8bPsSVjckYPYJrQVg%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "[email protected]" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CAMVSFwaP-R8vuj2TmRpzuDrXPB11AoektrbDuhp2Ye69SfExvw%40mail.gmail.com.

