From 7fc2b431a457c37492449bbaba00a8426ffe8dd8 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 11 Sep 2016 17:02:49 +0200 Subject: [PATCH] DSD demod plugin: DV serial: fix filter, timeout value and volume control --- Readme.md | 2 +- plugins/channel/demoddsd/readme.md | 6 ++++-- sdrbase/dsp/dvserialworker.cpp | 8 +++++--- sdrbase/dsp/filtermbe.cpp | 4 +++- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Readme.md b/Readme.md index 213a5bbda..a34c662ce 100644 --- a/Readme.md +++ b/Readme.md @@ -113,7 +113,7 @@ It is based on the [DSDcc](https://github.com/f4exb/dsdcc) C++ library which is If you have one or more serial devices interfacing the AMBE3000 chip in packet mode you can use them to decode AMBE voice frames. For that purpose you will need to compile with [SerialDV](https://github.com/f4exb/serialDV) support. Please refer to this project Readme.md to compile and install SerialDV. If you install it in a custom location say `/opt/install/serialdv` you will need to add these defines to the cmake command: `-DLIBSERIALDV_INCLUDE_DIR=/opt/install/serialdv/include/serialdv -DLIBSERIALDV_LIBRARY=/opt/install/serialdv/lib/libserialdv.so` -Although such serial devices work with a serial interface at 400 kb in practice maybe for other reasons they are capable of handling only one conversation at a time. The software will allocate the device dynamically to a conversation with an inactivity timeout of 500ms. In practice you will have to have as many devices connected to your system as the number of conversations you would like to be handled in parallel. +Although such serial devices work with a serial interface at 400 kb in practice maybe for other reasons they are capable of handling only one conversation at a time. The software will allocate the device dynamically to a conversation with an inactivity timeout of 1 second so that conversations do not get interrupted constantly making the audio output too choppy. In practice you will have to have as many devices connected to your system as the number of conversations you would like to be handled in parallel. Note that this is not supported in Windows because of trouble with COM port support (contributors welcome!). diff --git a/plugins/channel/demoddsd/readme.md b/plugins/channel/demoddsd/readme.md index 1c9bc0221..d070d8199 100644 --- a/plugins/channel/demoddsd/readme.md +++ b/plugins/channel/demoddsd/readme.md @@ -24,7 +24,7 @@ You can use a serial device connected to your system that implements and exposes - Compile with [SerialDV](https://github.com/f4exb/serialDV) support Please refer to this project Readme.md to compile and install SerialDV. If you install it in a custom location say `/opt/install/serialdv` you will need to add these defines to the cmake command: `-DLIBSERIALDV_INCLUDE_DIR=/opt/install/serialdv/include/serialdv -DLIBSERIALDV_LIBRARY=/opt/install/serialdv/lib/libserialdv.so` - Enable DV serial devices in your system by checking the option in the Preferences menu. YOu will need to enable the DV serial devices each time you start SDRangel. -Although such serial devices work with a serial interface at 400 kb in practice maybe for other reasons they are capable of handling only one conversation at a time. The software will allocate the device dynamically to a conversation with an inactivity timeout of 500ms. In practice you will have to have as many devices connected to your system as the number of conversations you would like to be handled in parallel. +Although such serial devices work with a serial interface at 400 kb in practice maybe for other reasons they are capable of handling only one conversation at a time. The software will allocate the device dynamically to a conversation with an inactivity timeout of 1 second so that conversations do not get interrupted constantly making the audio output too choppy. In practice you will have to have as many devices connected to your system as the number of conversations you would like to be handled in parallel. Note also that this is not supported in Windows because of trouble with COM port support (contributors welcome!). @@ -116,7 +116,9 @@ This is the gain applied to the output of the discriminator before the decoder

13: Audio volume

-This is the audio volume for positive values. A value of zero triggers the auto volume (audio AGC). +When working with mbelib this is a linear multiplication factor. A value of zero triggers the auto gain feature. + +With the DV serial device(s) amplification factor in dB is given by `(value - 3.0)*5.0`. In most practical cases the middle value of 5.0 (+10 dB) is a comfortable level.

14: Maximum expected FM deviation

diff --git a/sdrbase/dsp/dvserialworker.cpp b/sdrbase/dsp/dvserialworker.cpp index 789b7a6d6..d0c6b2fda 100644 --- a/sdrbase/dsp/dvserialworker.cpp +++ b/sdrbase/dsp/dvserialworker.cpp @@ -73,15 +73,15 @@ void DVSerialWorker::stop() void DVSerialWorker::handleInputMessages() { + m_timer->stop(); // suspend FIFO queue holding timeout Message* message; - m_timer->start(500); // FIFO queue holding timeout while ((message = m_inputMessageQueue.pop()) != 0) { if (MsgMbeDecode::match(*message)) { MsgMbeDecode *decodeMsg = (MsgMbeDecode *) message; - int dBVolume = (decodeMsg->getVolumeIndex() - 50) / 2; + int dBVolume = (decodeMsg->getVolumeIndex() - 30) / 2; if (m_dvController.decode(m_dvAudioSamples, decodeMsg->getMbeFrame(), decodeMsg->getMbeRate(), dBVolume)) { @@ -95,6 +95,8 @@ void DVSerialWorker::handleInputMessages() delete message; } + + m_timer->start(1000); // FIFO queue holding timeout } void DVSerialWorker::pushMbeFrame(const unsigned char *mbeFrame, @@ -122,7 +124,7 @@ void DVSerialWorker::upsample6(short *in, int nbSamplesIn, unsigned char channel for (int j = 1; j < 7; j++) { - upsample = (qint16) ((cur*j + prev*(6-j)) / 6); + upsample = m_upsampleFilter.run((qint16) ((cur*j + prev*(6-j)) / 6)); m_audioBuffer[m_audioBufferFill].l = channels & 1 ? upsample : 0; m_audioBuffer[m_audioBufferFill].r = (channels>>1) & 1 ? upsample : 0; ++m_audioBufferFill; diff --git a/sdrbase/dsp/filtermbe.cpp b/sdrbase/dsp/filtermbe.cpp index e8470569b..a4b5b0f85 100644 --- a/sdrbase/dsp/filtermbe.cpp +++ b/sdrbase/dsp/filtermbe.cpp @@ -24,7 +24,9 @@ const float MBEAudioInterpolatorFilter::m_b1 = 1.392667E+00; const float MBEAudioInterpolatorFilter::m_b2 = -5.474446E-01; MBEAudioInterpolatorFilter::MBEAudioInterpolatorFilter() -{} +{ + init(); +} MBEAudioInterpolatorFilter::~MBEAudioInterpolatorFilter() {}