airspy / airspyhf

Code repository for AirspyHF+
BSD 3-Clause "New" or "Revised" License
146 stars 40 forks source link

The airspyhf/tools/src/README omits AM Modulation Examples #48

Closed rogerxxxx closed 5 months ago

rogerxxxx commented 5 months ago

The airspyhf/tools/src/README omits AM Modulation Examples (eg. AM, LSB, USB, ...)

Comparing airspyhf tools README with the csdr README, I was able see what was needed for csdr compatability with airspyhf hardware, for further modifying the csdr incantation/pipes for AM modulation.

1) Remove the shift_addition_cc pipe, think this is for the rtl-sdr hardware not being accurate.

2) Augment the csdr fir_decimate_cc pipe with airspyhf's "2 0.25 HAMMING" values.

3) Included an additional "csdr fractional_decimator_ff 8" pipe.

$ airspyhf_rx -z -d -r stdout -f 0.970 | csdr fir_decimate_cc 2 0.25 HAMMING | csdr amdemod_cf | csdr fastdcblock_ff | csdr agc_ff | csdr limit_ff | csdr fractional_decimator_ff 8 | csdr convert_f_s16 | play -t s16 -r 48000 -

From here, users should be able to get SSB LSB/USB working too.

Next on my list, NFM.

touil commented 5 months ago

Imagine the kind of exotic insults you will get if you open an issue on the Linux kernel repos asking for examples on how to use vim.

rogerxxxx commented 5 months ago

Why all the snide comments?

touil commented 5 months ago

You didn't get "Torvalds moment" insults, that's already a good thing. Consider that an SDR (any SDR) is for csdr what the Linux kernel is for user space applications.

rogerxxxx commented 5 months ago

I was on the Linux kernel mailing list ~20 years ago and from what I can recall, everybody was very helpful with no apparent intentions for defaming others.

If somebody posted a VIM question, I'm pretty sure most would provide further insight and forward as needed.

"Torvalds moment" insults sounds more of being used as a stigma or an unreasonable just cause of discrimination.

Anyways, the main difficulty with csdr is getting the correct decimation. Without the correctly calculated decimation values, csdr will not work properly with devices, and further debugging with the airspyhf devices on Linux becomes nearly impossible. Especially with only having one graphical program being able to confirm the (airspy) device is working. (eg. Linux sdrpp) Since it seems the decimation values are dependent upon each device's sample rate output, each manufacturers' sdr device likely requires a different decimation value. I could be wrong here, but if I'm right, would be insane to require the author of csdr for providing decimation values for each and every device, along with csdr incantation lines for each and every device made. Would be quite trivial for the manufacturer to complete at least an AM modulation csdr incantation, and/or also NFM/LSB/USB basic modulation examples.

Also, I strongly believe I am now seeing a bug while using my airspyhf device within Linux, where I am inadvertently loosing gain, making signals inaudible across the bands. Sporadically, sometimes/rarely the gain corrects itself after triggering modulation (eg. am, fm, nfm, ...) within sdrpp. Would be much far easier, to either rule-out and troubleshoot/debug this using a much smaller program such as csdr.

Regardless, I think I tried the csdr AM modulation line here many times the other night while listening to shortwave, and likely found the device exhibiting the significantly reduced gain across bands the other night. Would be really easy to recompile csdr and lib airspyhf/airspyhf-dev packages with debug flags, rather than working with a far larger graphical program such as sdrpp, not only this, but seems a maintainer over there seems to be having some difficulties, without going into details. And am guessing, if I start posting questions concerning recompiling sdrpp with debug flags, performing back-traces, etc, may not get very far.

Because csdr also exhibited problems, 5000 kHz WWV was not audible (eg. low/negligible gain), and the station below was a few kHz's off-center and/or heard across bands, it's very likely the bug lies within the airspyhf libraries. Likely the AGC (automatic gain) is flipping-out, while the Windows sdrsharp seems to be very consistent with gain levels, if not appearing as if the pre-amp (amp for increased gain) is turned-on when denoted as being turned-off. Linux sdrpp I had flipped inadvertently from high to a very low gain, and then back again.

Shrugs...

Within the next couple of nights, I'll perform more debugging (or run tests) to confirm what works with csdr (eg. fm, then am, then reboot into windows using sdrsharp and reboot into linux, ...)

If somebody wants to confirm I have the decimation (eg fir_decimate_cc 2 0.25) correct for AM modulation, great. So far though, just using sdrpp, doesn't look like the device is at all stable on Linux using airspyhf-1.6.8_1. I'll keep tinkering, and once I get a good backtrace of the event, further submit a bug report. This Linux gain instability resulted in having to bang on Windows O/S today, for performing an experiment with the eclipse with HF WWV clock. My guess though, this bug is well known, as to where it is though, don't know, with most just giving up.

rogerxxxx commented 5 months ago

It's not perfect, with what little knowledge I have on radio, but do appear to have AM LSB/USB working utilizing csdr, just not including the entire bandwidth including the Hawaiian female voice, seems weak. Whether due to gain, improper filters/pipes, size of bandwidth, shrugs.

WWV 5000 kHz AM USB

 $ airspyhf_rx -z -d -r stdout -f 5.000 | csdr fir_decimate_cc 2 0.25 HAMMING | csdr bandpass_fir_fft_cc 0 0.1 0.05 | csdr realpart_cf | csdr agc_ff | csdr limit_ff | csdr fractional_decimator_ff 8 | csdr convert_f_s16 |  play -t s16 -r 48000 -

WWV 5000 kHz AM LSB

$ airspyhf_rx -z -d -r stdout -f 5.000 | csdr fir_decimate_cc 2 0.25 HAMMING | csdr bandpass_fir_fft_cc -0.1 0 0.05 | csdr realpart_cf | csdr agc_ff | csdr limit_ff | csdr fractional_decimator_ff 8 | csdr convert_f_s16 |  play -t s16 -r 48000 -

Also need to get the proper incantation for the full frequency of the shortwave station, rather than just SSB.

This might be it, but doesn't seem right using the realpart filter.

$  airspyhf_rx -z -d -r stdout -f 5.000 | csdr fir_decimate_cc 2 0.25 HAMMING | csdr bandpass_fir_fft_cc -0.1 0.1 0.05 | csdr realpart_cf | csdr agc_ff | csdr limit_ff | csdr gain_ff 1 | csdr fractional_decimator_ff 8 | csdr convert_f_s16 |  play -t s16 -r 48000 -

So far, tonight, the unit has had steady gain, but have not power cycled during reboots, and will back-off from this issue/bug unless somebody wants to document the proper incantations.

At this point, think I have enough working, that I can further track or repetitively reproduce possible problems/issues. As to why the sudden drop in gains, shrugs, weird, antenna is stable, wiring appears stable, shrugs...

Thank you for your time. And yes, I dislike writing markdown/html, would rather be using a real text editor. NOTE: Still do not have regular AM Modulation working.

touil commented 5 months ago

I propose you move all of this to the csdr repo. Totally unrelated to Airspy.