Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CIC based DDC #30

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

CIC based DDC #30

wants to merge 11 commits into from

Conversation

tejeez
Copy link
Contributor

@tejeez tejeez commented Oct 30, 2017

To be able to use OpenWebRX at high sample rates (5-50 MHz), I've written an optimized cascaded-integrator-comb based down-converter. To give some numbers on its speed, it takes 20% of one core on an Intel Q9400 processing a complex signal at 30 Msps.

So far, I've only optimized the DDC on 64-bit x86 machines, and it uses 64-bit integers and a sine table whose size is chosen to fit in the typical L1 cache they have. It should work on ARM and other 32-bit machines too but I have no idea about its performance on them. A 32-bit optimized version is something I could attempt next though.

To implement a delay buffer feature (mainly for use in OpenWebRX) and to further improve performance, this can also read directly from an shmbuffer without pipes. There's also some additional features for FFT functions to somewhat reduce CPU use.

I really should have contributed this half a year ago when I made it, but thought I should do some cleanup and some more testing and optimizing... Now that I've successfully used it for 6 months and haven't done anything for it, I decided it's already useful enough to make a pull request. Better to merge it now before our csdr branches diverge too much! (Btw, as tabs had changed to 4 spaces in the code, merge seemed really frustrating until I realized git had the -Xignore-space-change option!)

@ha7ilm
Copy link
Owner

ha7ilm commented Nov 2, 2017

To give some numbers on its speed, it takes 20% of one core on an Intel Q9400 processing a complex signal at 30 Msps.

Wow! Looks great!

@tejeez
Copy link
Contributor Author

tejeez commented Nov 2, 2017

Btw, the CIC should usually be used as the first stage of a two-stage (or more) resampler because the CIC itself has a quite sloppy frequency response. Should maybe write some documentation about it...

I've made the changes to openwebrx for this multiple-stage decimation and use of shmbuffer for history, but merging them with other latest openwebrx changes will need some more work because I haven't that actively maintained the fork. I'll try to do it soon. Of course, the DDC can be used in other csdr applications even if not yet integrated into mainline openwebrx.

@ha7ilm
Copy link
Owner

ha7ilm commented Nov 2, 2017

Yes, some documentation would help me to better understand the code.

There are 3 places where I usually put documentation:

  • at the beginning of csdr.c, where the output of --help resides, there is the full syntax of each command,
  • I also put the full syntax of the command in a comment to the place where it is in csdr.c (on the !strcmp line)
  • I write about the syntax, the concrete use cases and sample commands if needed in README.md.

@ha7ilm
Copy link
Owner

ha7ilm commented Nov 2, 2017

Anyway, what you do sounds really great, thanks for working on that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants