Giter Site home page Giter Site logo

Create FM squelch control about sdrtrunk HOT 14 CLOSED

dsheirer avatar dsheirer commented on July 20, 2024 12
Create FM squelch control

from sdrtrunk.

Comments (14)

Handwrit avatar Handwrit commented on July 20, 2024 2

Because I live in a rural area, we have a mix of non-trunked P25 and FM. The police use P25, but fire/ambulance uses FMN. It would be nice to be able to use just one program.

Any idea how solvable FM squelch is? It looks like something as simple as "if this area of the waterfall turns red enough, then unsquelch" would work alright.

from sdrtrunk.

jameswilkersonctl avatar jameswilkersonctl commented on July 20, 2024 2

Just wondering if anyone has made updates to the squelch? I am looking at the code and thinking of taking a swing at it.
Wanted to make sure I am not duplicating efforts.

from sdrtrunk.

DSheirer avatar DSheirer commented on July 20, 2024 1

It isn't too hard to implement ... just requires time. I'll try to get this added soon.

from sdrtrunk.

BloodBlight avatar BloodBlight commented on July 20, 2024 1

I noticed that this is on the list for both milestone 0.5 and 0.6. This would be supper helpful I think. I am trying to monitor the Marine bands, and there are a lot of them. :)

from sdrtrunk.

ahoy avatar ahoy commented on July 20, 2024

@DSheirer Do you have a high level idea of how to accomplish this? I would like to take a crack at implementing this using Gnuradio's simple_squelch method.

from sdrtrunk.

DSheirer avatar DSheirer commented on July 20, 2024

I've been on travel the last 2 weeks, sorry for the delayed response.

Some background .... the ChannelState class (and any subclass implementations) controls the squelch state for audio to be distributed. It receives DecoderStateEvent instances from any of the DecoderState or Decoder component instances.

The DecoderFactory.getPrimaryModules() method creates the modules that make up the FM decoder.

The FMDemodulatorModule receives complex sample buffers, performs baseband (IQ) filtering and FM demodulation and produces unfiltered real sample buffers. The

The DemodulatedAudioFilterModule performs filtering on the unfiltered real sample buffers to condition the audio for the audio module.

The AudioModule listens for SquelchState signals from the ChannelState and receives demodulated real sample buffers and converts them to audio buffers.

The AlwaysUnsquelchedDecoderState controls audio squelching by essentially setting to it always unsquelched.

(end background)

I'm assuming that you're going to be monitoring the incoming complex sample buffers to detect the presence of a modulated signal. I'd recommend:

Create a new FMSquelch class that extends Module and implements both IComplexBufferListener and IDecoderStateProvider interfaces. The IComplexBufferListener interface allows you to receive complex baseband samples for the channel so that you can monitor for signal in each buffer. The IDecoderStateProvider interface allows you to broadcast DecoderStateEvents to the processing chain to command the ChannelState to (un)squelch the audio output for the channel.

Another (preferred) option is to extend the FMDemodulatorModule to add the FMSquelch functionality. This would allow you to control which baseband buffers get demodulated and passed on to the rest of the chain. Otherwise, you'd simply be turning the audio playback squelch on and off, but otherwise all baseband buffers would still be demodulated.

You'll have to issue an initial DecoderStateEvent using the Event.START and then follow that up with a continuous stream of Event.CONTINUE and finally an Event.END. The ChannelState receives these events and controls the overall squelch state for the channel. If the ChannelState doesn't receive a a DecoderStateEvent within 1200 milliseconds, it will change the channel state to FADE and then in 2000 milliseconds, it will reset the ChannelState to IDLE. Therefore, you need to broadcast a DecoderStateEvent at least every <1200 milliseconds to maintain the squelch state. Once you send the START event, you can probably send a CONTINUE event for each buffer that contains a modulated signal, then issue an END event on the first buffer that doesn't contain a signal.

The FM demodulator currently uses the AlwaysUnsquelchedDecoderState, but you can create a new class that extends DecoderState that doesn't automatically set the squelch on startup. If you look at the AlwaysUnsquelchedDecoderState, you can copy it and simply leave out the part where it broadcasts the ALWAYS_UNSQUELCHED event.

Update the DecoderFactory to use your new Squelch class and the new DecoderState class for the NBFM decoder module stack.

from sdrtrunk.

DSheirer avatar DSheirer commented on July 20, 2024

An additional comment ... in version 0.4.0 I'm changing the channel sample rate from a default of 48kHz to a variable sample rate between 25.0 - 50.0 kHz. Normally this will be a 12.5 kHz filtered channel that has 2x oversampling to 25.0 kHz. But, depending on the overall sample rate of the tuner, I may not be able to get an even/clean 12.5 kHz channelization, and therefore the channel sample rate could go to just under 50.0 kHz.

from sdrtrunk.

ahoy avatar ahoy commented on July 20, 2024

Thanks for all the info. I've been (slowly) trying out a couple different approaches to this, but I can't seem to get anything reliable. I really like the idea of "short circuting" the signal path to keep squelched packets from getting any farther down the processing chain.
I was digging around in the gnuradio source and found that they use "tagging," which allows metadata to be attached to the raw packets. Tagging packets of IQ with signal strength can be used early on, as well as extracted by the UI to display some sort of an S meter. This would be handy for squelch adjustment.

Slightly off topic... is this an appropriate place to discuss the development of this?

Thanks and more thanks for this great project!

from sdrtrunk.

DSheirer avatar DSheirer commented on July 20, 2024

No worries ... if it relates to the FM squelch issue, it's on topic or you can email me directly.

from sdrtrunk.

Handwrit avatar Handwrit commented on July 20, 2024

I'm very appreciative! I'm also well aware that the name "SDRTrunk" pretty much implies mine is an edge case.

from sdrtrunk.

DaveNF2G avatar DaveNF2G commented on July 20, 2024

Curious about progress on this. I get a lot of junk decodes in LTR-Passport because the program is trying to read the noise.

I also like the QCII idea and would like to suggest GE*Star as well.

from sdrtrunk.

ah1102 avatar ah1102 commented on July 20, 2024

I would also like to see in the program noise reduction for analog FM and AM. I also noticed an echo in NFM.

The program may be more universal. With hackrf, it would be possible to have multichannel reception on the air or amateur radio.

from sdrtrunk.

ivanpiter avatar ivanpiter commented on July 20, 2024

Dear Denny!

Please, add squelch for NBFM and AM demodulators because they are useless for me without it.
It s mixed analog and digital system around me and without squelch I can not use your perfect software effectively.
Here is my typical mixed radio frequency environment:
изображение

It isn't too hard to implement ... just requires time. I'll try to get this added soon.

from sdrtrunk.

DSheirer avatar DSheirer commented on July 20, 2024

I haven't started anything on this yet.

from sdrtrunk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.