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

New converters: u16o12 and s16 #109

Closed
wants to merge 4 commits into from

Conversation

gtjoseph
Copy link

@gtjoseph gtjoseph commented Feb 8, 2021

Includes...

  • Adding stubs to convert.c
  • Creating the magnitude_s16 and magnitude_u16o12 dsp implementations.
  • Running starchgen to recreate the generated files.
  • Running full benchmarks

s16: signed 16-bit ( -32767 -> 32767 )
u16o12: unsigned 16-bit offset 12 ( 1 -> 4095 )
	representing ( -2047 -> 2047 )
* Add includes for stdlib.h and tables.h
* Fix an incorrect shift in exact_unroll_8
Ran full benchmarks on rpi4b/aarch64, rpi4b/arm, nvidia-tegra/aarch64
and i7-6950x/x86_64.  Output is in:

wisdom/wisdom.aarch64.pi4b
wisdom/wisdom.aarch64.tegra
wisdom/wisdom.arm.pi4b
wisdom/[email protected]

This includes all current dsp implementations.
 * wisdom/wisdom.aarch64.pi4b
 * wisdom/wisdom.aarch64.tegra
@gtjoseph
Copy link
Author

gtjoseph commented Feb 8, 2021

Expedited review would help a great deal since I've got 3 more branches/commits that rely on this one. :)

@mutability
Copy link

I think we're going to need to work on a separate branch for these changes (& the associated airspy changes). There's a release coming up which needs the dev branch stabilized, and I'm not comfortable with getting all the airspy stuff merged before that; but I don't want to stall your work either.

I created an airspy branch based on the current dev branch; let's try getting your changes merged there, and I can merge back to dev once the release is done.

@mutability mutability changed the base branch from dev to airspy February 9, 2021 06:20
convert.h Show resolved Hide resolved
dsp/benchmark/magnitude_u16o12_benchmark.c Show resolved Hide resolved
* Signed Scaled
* Input Value Magnitude
* ------------------------------
* 0 <invalid> <invalid>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is raw ADC output, then 0 is probably a valid value, let's handle it.

You could either shift the whole scale by 0.5 (i.e. ADC value of 2047.5 is magnitude 0), or saturate input 0 -> magnitude 65535, or tweak the scale factor slightly such that it doesn't actually reach 65535 at both ends.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been testing for that 0 for months now and haven't run across it and the definition of the offset representation specifically says it's invalid. I chose the scaling I did so that a max negative (-2047) and a max positive (2047) became 65535 on output. For the lookup table, I can add a value in the 0 slot. The calculation will simply return a rolled over value for that sample which should be no big deal.

dsp/impl/magnitude_u16o12.c Show resolved Hide resolved
dsp/impl/magnitude_u16o12.c Show resolved Hide resolved
dsp/helpers/tables.c Show resolved Hide resolved
dsp/helpers/tables.c Show resolved Hide resolved
@gtjoseph
Copy link
Author

gtjoseph commented Feb 9, 2021

Superceeded by pull request #112

@gtjoseph gtjoseph closed this Feb 9, 2021
mutability added a commit that referenced this pull request Feb 11, 2021
nb: regenerated starch files *not* committed yet, in the name of
minimizing merge conflicts for the moment.
@gtjoseph gtjoseph deleted the dev-fa-01-converters branch July 5, 2021 21:07
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.

None yet

2 participants