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

Configurable de-emphasis time constant for analog recorders #975

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

Conversation

algertc
Copy link

@algertc algertc commented Sep 16, 2024

Related to #187 #511

As mentioned in the above issues, many analog VHF low-band public safety frequencies use a higher de-emphasis time constant. After much confusion trying to set up a 42 MHz highway patrol stream and consistently getting distorted audio, I eventually found the value in the analog_reocorder set to 75µs. Adjusting it fixed the distortion, and the stream sounded as I had originally expected.

Looks like #511 was forgotten about, but it seems like a sensible addition as most broadcasters running into this problem are never going to find that file and rebuild. Would have saved me a boatload of time as a first-time user.

Example config.json:

"systems": [
        {
            "type": "conventional",
            "channels": [],
            "squelch": -60,
            "deemphasisTau": 0.000530
        }
]

@cschmittiey
Copy link
Contributor

Hey I mentioned this in the discord as well but would you mind also documenting the configuration option in CONFIGURE.md? would be helpful for those of us that help out with configuration questions in the discord to be able to point to what the option does and when it's helpful for people to adjust.

@taclane
Copy link
Contributor

taclane commented Sep 17, 2024

If you can, have you tried a value of
"deemphasisTau": 0.000750 (i.e. 750 μs)
in your patched config? This is generally the "correct" value for analog LMR systems.

There was an attempt to correct it from the current 0.000075, but everyone was used to the "brighter" and "louder" sound of 75 μs, so it got reverted. It's possible that maybe it should be re-investigated anyway; lots of things have changed in the last few years.

As far as documentation goes, these are generally not values a user is going to freehand. The de-emphasis value on the receiving end is supposed to match the pre-emphasis value of the transmitter. That way, it can correctly unskew the received audio to correct for how it was transmitted. Some typical values for this include: 50 μs (WFM euro), 75 μs (WFM USA), 750 μs (NFM LMR)

Trunk Recorder using 75 μs is something of compromise. It sounds reasonably okay, but it's probably not the ideal tau value for most systems.

@algertc
Copy link
Author

algertc commented Sep 18, 2024

I have tried 750 and can't tell much of a difference. The reason I used 530 is because that was what GQRX suggested for narrow fm. I can't really find any good official source or spec for what is actually used.

Also, in terms of acclimation to the "brighter" sound, I'm not sure if that's for people trying to record broadcast or what, but my audio is still very good volume and not dull at all. Without the filter it's borderline unintelligible.

@taclane
Copy link
Contributor

taclane commented Sep 18, 2024

The audio using 75 vs 750 µs sounds bright and loud because the de-emph filter essentially isn't working. The cut-off frequency where the filter starts de-skewing the audio is too far out, and it leaves in much of the pre-emphasized audio from the transmission. The net result is that it sounds louder, but the frequencies we're hearing aren't representative of what was entering the microphone.

Since the decision to continue using 75 µs a few years ago, there have been few changes regarding audio volume and normalization. It's entirely possible that the "quiet" analog issues no longer apply and the default should be updated.

As far as 530 vs 750 µs, they're at least in the same ballpark (cut-off freqs of 300 and 212 Hz) compared to 75 µs (2122 Hz). I'm not sure what systems use the values offered in the GQRX dropdown, but if you look up the spec sheets for LMR equipment, you'll see it noted somewhere like:

FM Hum and Noise (750 μs de-emphasis)
25 kHz / 12.5 kHz

@taclane
Copy link
Contributor

taclane commented Sep 19, 2024

Other thoughts:

  • Trunk Recorder should default the analog time constant to 750 µs as originally discussed in LMR FM pre-emphasis uses a time constant of 750 µs #478. It does not appear that the earlier issues concerning gain still exist, and it makes an immediate improvement in NFM audio quality for LMR systems with no additional configuration needed.
  • Smartnet systems will be using 750 µs, so simply updating the default should have them covered. Would be worthwhile to extend this configuration option to analog trunked recorders?

@ZeroChaos-
Copy link
Sponsor

I think changing this to the spec default value of 750 and accepting this PR is the best of all choices. Folks who want to tune it can, and we can use the spec default by...default. Thanks for the work @algertc

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.

4 participants