telegraphic / pfb_introduction

An interactive introduction to the polyphase filterbank technique for radio astronomy spectrometers
51 stars 16 forks source link

rfft -> fft and python3 command line usage updates #3

Closed evanmayer closed 4 years ago

evanmayer commented 4 years ago

This example was super useful, but I had some trouble running it on the command line with python3.

Some changes:

You can take or leave these changes, of course! More importantly:

telegraphic commented 4 years ago

Hey @evanmayer -- fantastic stuff, happy to merge. Just a thought: would it be worth adding some example SDR data to the repo?

evanmayer commented 4 years ago

Sure! I'm sure several SDR users with gnuradio spectrometers have viewed this, trying to understand what the heck their gnuradio PFB block was doing, it could be relevant. What do you think the best way to get that in would be? I can stream some IQ data with a signal in it to a text file, which can be np.loadtxt'd in to the data var and processed, but curious if you had something else in mind.

I also had a poke and a prod with my SDR data and realized I omitted a change: x_summed = np.zeros((P, M * W - M + 1)) was throwing away the imag part of any data I passed in, giving incorrect results after the FFT. If you don't mind changing the assumption of real data to the assumption of complex data, I can remedy that in another PR with a dtype=np.complex128. I think the results should be unchanged for your real-only generated data.

Let me know! Thanks again for the tutorial and paper, amateur 21cm astronomy is grateful.