A DSP speech processor based on the
Microchip
dsPIC33 Digital Signal Controller, designed to maximize voice levels
on communications transceivers.
A
homebrew speech processor designed for SSB applications.
Flattens the speech power spectrum and improves the peak-to-average ratio of speech to about 6dB, while maintaining good audio quality. Box size: 110 mm x 70 mm x 24 mm. Hardware features:
PCB cost: AUD$21 including AirMail delivery see below. Estimated parts cost: Around $50USD (not including PCBs). Estimated time to build:
About two days - depending on skill level.
|
Controls (Left to right) Button 1: MODE : Resets the display and operating mode to normal Transmit mode. Button 2: SELECT : Steps through the Select menu, to select different options. Button 3: - (minus) : Decrements selected option. Button 4: + (plus) : Increments selected option.LED Bargraph: LED 0 = Pre-emphasis Limiter. LED 1 = Band 1 (60 Hz-125 Hz). LED 2 = Band 2 (125 Hz-250 Hz). LED 3 = Band 3 (250 Hz-500 Hz). LED 4 = Band 4 (500 Hz-1 kHz). LED 5 = Band 5 (1 kHz-2 kHz). LED 6 = Band 6 (2 kHz-3 kHz or 2 kHz-4.5 kHz). LED 7 = Output Compressor. LED 8 = Hilbert Clipper. |
Using the economical 28 pin SPDIP dsPIC33FJ64GP802
by Microchip.
(or the dsPIC33FJ128GP802)
40 MIPS @ 3.3V, 16k RAM,
64k FLASH, built-in stereo audio DAC with 256x oversampling, 1 x 10/12
bit ADC, 16 bit CPU design, and many other features.
This processor is a real
DSP unit, and has many features to speed up processing such as:
Harvard architecture (separate
data and program busses).
Hardware support for multiply,
divide, MAC and data move instructions.
Two 40 bit DSP accumulators,
hardware multiplier, hardware divider (max 32/16 bit in only 18
CPU cycles), instruction prefetching, hardware saturation, hardware rounding,
barrel shifter, memory mapped IO, multiple DMA channels, multiple IRQs,
multiple clock sources, in-system low-voltage programming... the list goes
on!
If you are interested
in trying to build this unpublished design for an Amateur Radio or CB radio
application, contact the author at this email address:
If no reply is received
after two weeks, try again - Spam filtering may have deleted your message.
Please note:
This processor is designed
for maximum loudness, and doesn't try to be "Hi-Fi" - though on-air it
sounds very good - almost like a shortwave broadcasting station. This is
primarily due to the use of phase rotation, multiband compression and multiband
clipping - similar techniques to those used in broadcasting.
|
Standard audio processors do not suit Amateur radio use:* For SSB, limiting audio level does not control PEP levels accurately.* Most audio processors do not produce a flat output power spectrum required for best SNR on SSB and AM. * Most audio processors do not have the output ground loop isolation required to drive an unbalanced transceiver mike input. What this processor does right:* A Hilbert Clipper is used (IQ vectorsum controlled limiting) for best SSB PEP control.* A flat output power spectrum is produced. This matches the flat noise floor of SSB and AM. * Transceiver ground loops are prevented by using a ground loop cancellation output amplifier circuit. |
Some Speech Processing TheoryThe difference between the quietest and loudest dB levels in an audio signal is referred to as its "Dynamic Range".Due to the large dynamic range of unprocessed speech (greater than 30 dB according to various references), speech processing is widely used to reduce this range for consistent modulation. This is especially important for broadcasting and communication where the maximum peak level is limited by the maximum transmitter power level or the defined modulation standard. Both compression and peak clipping are used to reduce the dynamic range of audio content in these applications. AM and SSB systems have a flat noise spectrum, because they respond equally to noise across the passband. The unprocessed voice has a bass heavy spectrum, as the fundamental and low harmonics of the vocal cords are far stronger than the higher harmonics. FM systems have a noise spectrum that rises with frequency. Pre-emphasis is used in both AM/SSB and FM systems to compensate for these factors. "Loud, bright, clean - pick any two" is a well known choice in FM broadcasting. This is because the receiver de-emphasis makes low frequencies sound louder. To increase brightness, less bass energy is available - reducing loudness. To increase loudness, more clipping can be used which then increases distortion. Since most receivers have some type of de-emphasis or hi-cut filtering, this effect can also happen in communications gear. Multiband compressors are often used in broadcasting and music mastering applications because their action produces less undesirable effects than broadband compression (e.g. "pumping" and increased IMD). Essentially the audio spectrum is divided into bands by a filter bank, then compressed individually before being recombined - sometimes after additional filtering to suppress any compressor distortion products. The multiband compressor also has the effect of producing a more even spread of energy across the audio band, producing a flatter power spectrum. This is useful, as it matches the flat noise spectrum of SSB and AM systems. It gives all the voice frequencies a better chance of being heard above the noise floor, while maintaining a higher perceived quality. This is the approach used here. The multiband compression is teamed up with phase rotation, additional wideband compression and Hilbert clipping to significantly increase the average speech power without adding harmonic distortion, or excessive amounts of intermod distortion. This design will outperform any conventional analog processor, and any standard audio DSP processor.* With its reasonably flat audio spectrum, the processor produces a typical peak-to-average ratio of about 6dB (3kHz BW, Mode 4, clipping ON), while maintaining good quality. * Unprocessed audio
with excessive bass can produce high average RF power due to the bass having
a high duty cycle. This looks good on a power meter, but results in poor
readability in bad conditions.
SSB hates Square Waves!It has long been known that square wave audio fed into an SSB transmitter produces a very spiky RF output with a low average power. This is primarily due to the inherent Hilbert transform that occurs when generating SSB - either by phasing, Weaver, or filter methods. Virtually all SSB modulators also have a highpass response, causing a low frequency rolloff of the audio. The flat tops on a squarewave are essentially DC pulses, and they require an extrodinarily low frequency response in a modulator to faithfully reproduce the waveform without "tilt". This is impractical in a standard SSB transmitter due to the close spacing of these low frequencies to the opposite sideband.Ordinary peak clipping of speech waveforms causes flat tops that resemble square waves. It also adds harmonic distortion that makes the voice sound harsh, raucous and unpleasant. This makes it undesirable for SSB speech processing. Instead, clipping and filtering the SSB RF output produces a higher average power with only an increase in on-channel IMD (Intermod Distortion). IMD sounds far less objectionable on speech, so SSB RF clipping is far better for speech processing than audio clipping. SSB RF clipping has an equivalent, known as "Hilbert Clipping". Hilbert Clipping is straightforward to do in DSP, by using a "Hilbert Transform" to generate a "Q" (Quadrature) signal from the "I" (In-phase) input, then finding the vector sum of the I and Q signals and using it as a gain control signal. Effectively, the system acts as a compressor with zero attack and recovery time. The waveforms are limited without any squaring, causing IMD from the changing gain - but (ideally) no harmonic distortion. The output can be clipped heavily without generating square waves. Since the SSB RF envelope is proportional to the vector sum of the I and Q signals, it produces accurate clipping of the RF envelope. This produces higher average SSB RF power with low harmonic distortion, plus some on-channel intermod distortion.
|
Version PCB260.
Three PCBs in one set:
These PCBs have no errors. See pictures of the boards here.
The thinner 1.0mm PCB material improves mounting clearances of the LEDs, audio IC, and connectors.
Frank has built the PCBs into a 1U rack case to expand the I/O connectors and add extra controls:
An early test can be heard here.
Processor
demonstration. G0GSR (Frank) in QSO with M3ZDZ (another Daz), recorded
from Hack Green WebSDR. EDITED. This DSP Speech Processor is demonstrated,
along with a DBMax for comparison.
PCB sales and known working units, by country:
* Prototype/test units
Country | PCBs | Units |
Australia | 5/2* | 4 |
Brazil | 2 | 0 |
France | 1 | 0 |
Germany | 3 | 1 |
India | 8 | 13 |
Liechtenstein | 1 | 0 |
Netherlands | 3 | 0 |
New Zealand | 1 | 0 |
Norway | 1 | 0 |
Poland | 1 | 0 |
Portugal/Azores | 2 | 0 |
UK | 8 | 3 |
Ukraine | 1 | 0 |
USA | 3 | 0 |
Demo video & audioNov 25, 2016. Video of the DSP Speech Processor v2.1 in action - H.264/MP4 Format. This recording has been lowpass filtered to more closely replicate the sound of passing through transmit filtering. The "r" in receive mode shows Rx volume adjust is selected (- and + buttons change Rx Volume). The default transmit behaviour is to show Tx processing level number (- and + buttons change mode number). The LED "bargraph" is actually configured to show limiting action of each compressor or limiter stage. The LED ordering is: Pre-emphasis limiter, band 1 through band 6, output compressor and Hilbert Clipper stages. Audio was recorded via S/PDIF interface for best quality.
AudioAudio recording via HDSDR Flat receive (no de-emphasis) October 28, 2014.CB
chat August 8, 2015 NEW
Demonstration in 4.5kHz bandwidth. 27Mhz CB transceivers, 12W PEP over
a 15.7km non-LOS path. DSP Speech Processors used on both radios. Some
EQ applied to flatten receiver audio responses. Default Mode 5 on both
units. Recorded via TOSLINK output at each end of the QSO, then edited
together. SSB frequency correction was applied in Spectrum Lab to correct
mistuning.
LMS Noise Reduction test - 40m Amateur band2013-06-24-NR-test-7155kHz-1730-local.mp3NR is turned off for a short while in this MP3
to show effectiveness. Some audio clipping is heard - AGC routines are
still being adjusted.
2013-11-20-7150kHz-0150-local.mp3 NR is turned on at 21 seconds into this recording.
2013-12-13-VK2IY-VK2QA-40m-2100-local.mp3 NR is used throughout this recording. New Rx
AGC is used. What a great story by VK2IY Angus!
Measured specs (S/PDIF output)White Noise Spectrum Plot 25/02/2016 @-6dBFS - Mode 5.Measured 02/03/2016. Sinewave Distortion, Aliasing & Spurious levels - Processing mode 5 - Tested in Self-test mode. Frequencies are rounded
to the nearest Hz - Hanning window.
Some of the distortion
measured is due to spurii produced in the DDS sinewave routine.
Measured 07/02/2016. Sinewave Distortion, Aliasing & Spurious levels - Processing mode 5 - Tested in Self-test mode. Frequencies are rounded
to the nearest Hz - Hanning window.
Some of the distortion
measured is due to spurii produced in the DDS sinewave routine.
Measured 07/02/2016. Noise level, measured by waveform statistics, S/PDIF output @5.5kHz BW. Electret unplugged, gain at minimum. Mode 5: -38.59dBFS RMS - Noise Gate off. Mode 5: -59.39dBFS RMS - Noise Gate on.
Measured 10/11/2013. Noise level, measured by waveform statistics, S/PDIF output @5.5kHz BW. Mode 0: -84.07dBFS RMS - Electret unplugged, gain at minimum. Mode 4: -42.81dBFS RMS - Noise Gate off. Mode 4: -57.61dBFS RMS - Noise Gate on. Compression @689Hz
= 29.15dB.
Measured 19/08/2013 after more input gain optimization. Noise level, measured by waveform statistics, S/PDIF output @5.5kHz BW. Mode 0: -86.00dBFS RMS - Mike input shorted.
Measured 17/08/2013. Noise level, measured by waveform statistics, S/PDIF output @5.5kHz BW. Mode 0: -84.07dBFS RMS - Electret unplugged, gain at minimum. Mode 0: -72.24dBFS Peak - Mike input shorted. Mode 0: -84.30dBFS RMS - Mike input shorted. Mode 0: -85.39dBFS RMS - ADC input shorted. The microphone amplifier appears to be making a minimal contribution to the input noise. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Power ConsumptionUnder 5 Watts (Transmit mode).Current drain: as of 06/11/2013
@ 13.8 Volts.
If current consumption
is much higher than this, test for audio amp oscillation, a short circuit,
or a failed SMD regulator.
|
The new firmware has some differences:
Weaver SSB Modulator
The Weaver SSB modulator multiplies a quadrature carrier with the audio input and lowpass filters the result. The carriers are produced by a software DDS sinewave generator, as this has the most accurate amplitude and phase. The carrier frequency is positioned halfway up the passband: 1.51kHz for 3kHz BW, and 2.25kHz for 4.5kHz BW. The DDS frequencies are carefully chosen to minimize spurious sidebands from the DDS. The SSB filter is a 6-pole IIR lowpass filter. This passes the difference frequency, and blocks the sum frequency of the mixing. The SSB is centered on 0 Hz and includes positive and negative frequencies. Hilbert Clipper
The updated Hilbert clipper uses an "equiripple" magnitude estimator which has higher accuracy (<1% error) than the previous version. This reduces overshoot by improving clipping accuracy, while also saving CPU cycles compared to a normal vectorsum computation by avoiding the need for a complicated square-root math function. IQ FIR Lowpass Filter
1
Both lowpass filters that follow the Hilbert clipper
are FIR types for linear phase and minimum overshoot. Some overshoot is
caused by spectral truncation (removed frequencies) and so an overshoot
clipper is used next.
|
CESSB
Overshoot Clipper
After the first FIR filter, the SSB signal will have some overshoots that are detected in the CESSB overshoot clipper. The clipper control signal is amplified to overcompensate the clipping action, and the overshoots are reduced below 100%, instead of being clipped at 100%. This compensates for the overshoot from the next filter. IQ FIR Lowpass Filter
2
Since the overshoots were reduced below 100%, the overshoot from this final FIR filter doesn't cause the peaks to significantly overshoot beyond 100%. The clipper reference level of 100% is set to -6dBFS, to allow headroom for any residual overshoots (~0.1dB) to avoid distortion. Weaver SSB Demodulator
The recovered audio is then passed on to the output EQ stage to compensate for the non-flat transceiver response, the same way the old firmware did. |
Initialization
At power-on, the software routines are configured to work in an orderly way. The software Stack is configured. CPU clock is configured. I/O pins are configured. Analog AGC is set fully on to charge microphone amplifier capacitors. This takes about 2 seconds. RAM is cleared to prevent IIR filter oscillation. Coefficients are copied from program memory into "Y" RAM. Variables are set. Hardware peripherals are configured. Interrupts are enabled. Saved settings are loaded from Flash memory. Transmit Mode Analog microphone input
AGC
A "Hang timer" has been
added. This helps stabilize the gain level, and prevents excessive compression
at high input gain settings.
FIR oversampling filters
DMA is used to collect 16 samples into RAM, and avoid CPU overhead. The DMA buffer is now configured in "Ping Pong" mode for greater timing freedom. FIR filter #1 runs at 176.4kHz. It lowpass filters the 16 samples at 5.5kHz with a stopband of 22kHz, and outputs 4 samples at a sample rate of 44.1kHz. Only 4 samples are computed for efficiency. FIR filter #2 lowpass filters the 4 samples at 5kHz with a stopband of 11kHz, and outputs 2 samples at a sample rate of 22.05kHz. Only 2 samples are computed for efficiency. FIR filter #3 lowpass filters the 2 samples at 4.5kHz with a stopband of 5.5kHz, and outputs 1 sample at the final rate of 11.025kHz. Three FIR filters are used to improve filter performance. The FIR filter structure uses the very efficient pipelined modes of the dsPIC and the repeat instruction for fast, no overhead looping. Oversampling at 16 times increases the effective ADC resolution to 14 bits for a maximum input S/N ratio of 84dB, and suppresses aliasing.
|
DC
blocking
Cancels DC offset using an integrator to follow the average input value. The integrator output is then subtracted from the audio signal to cancel the offset. Doesn't add roundoff noise, so is quieter than an IIR filter. Doesn't suffer from typical IIR overflow problems. Has less phase shift than an IIR filter. Has less rejection of low frequencies than an IIR filter. Dynamic pre-emphasis
The first green bargraph LED shows pre-emphasis limiting action (LED 0). Aug 27, 2014: Noisegate added. Adding a noise gate here improves the performance of the following multiband compressor noisegates. Sep 20, 2014: Dynamic pre-emphasis filter changed to 1500 Hz IIR HPF, for improved EQ with current settings. Nov 03, 2014: Dynamic pre-emphasis filter is currently a 1 kHz IIR HPF, for improved EQ with current settings. Dec 31, 2015: Dynamic pre-emphasis has been increased by 6dB to allow more EQ when using flat microphones. Multi-stage 32-bit error
feedback IIR phase rotator
The phase rotation code has been pipelined to reduce CPU usage. The 16-bit IIR phase rotator suffered from circulating roundoff noise that added spurious signals at around -40dB. Even though this noise was not readily audible, the phase rotator has now been upgraded to use 32-bit error feedback. The spurious products of the phase rotator are now down to around -84dB or better. Nov 03, 2014: The Phase Rotator has been moved back before the Multiband Compressor, to improve waveform symmetry in all compressors. The Dynamic function has been removed. Currently, the benefits of placing the Phase Rotator before all the compressors seems greater than attempting to dynamically optimize the phase at a single stage of the processing. Apr 24, 2014: The Phase Rotator number of stages is now selectable. Minimum is 1, maximum is 26, default is 20. This selection can peak the average SSB power on voice. The maximum number of stages is limited by total CPU usage. Selecting 26 stages runs the CPU load very close to 100%. Sep 20, 2014: The Phase Rotator centre frequency adjustment is now a selection of preset frequencies: 100 Hz, 110 Hz, 140 Hz, 200 Hz, 400 Hz, 600 Hz. *These frequencies are approximate - the originally listed frequencies were in error by about a factor of two. Sep 24, 2014: The Phase Rotator presets now also load a setting for an optimized number of stages for each frequency selection. |
Multiband look-ahead compressor
A multiband compressor reduces
the dynamic range of the audio with few compression artifacts, and flattens
the spectrum power of the voice for more even clipping at all frequencies.
Produces large amounts of bass, treble and midrange energy simultaneously.
This improves quality, and allows a greater amount of clipping. The current
version uses six bands,
each one octave wide. Each band has a 13mS delay buffer. Now includes HF
gain trimming for microphone flatness compensation (Select menu "_"
Flatness adjust).
This multiband compressor
is a composite of 24 IIR Butterworth filters, and 6 individual compressors.
The look-ahead structure
used in all the compressors allows a slower attack time without signal
clipping. This reduces distortion. The multiband compressors are essentially
overshoot free. Short peaks are best removed by the Hilbert clipper stage,
so the Output compressor doesn't attempt to be overshoot free, just low
distortion.
The compressors measure the signal magnitude by simply taking the absolute value of the audio samples. The magnitude is converted to an inverse function by dividing it into a large number to produce a control signal. The control signal is then slew-limited for slower attack, smoothed for controlled release, and clipped to limit the maximum gain. This method has good performance and very predictable levels. A small RAM buffer delays the audio before the samples are multiplied by the control signal, which brings the output to a constant level (above threshold). This produces a compression ratio of infinity, and the forward acting structure ensures unconditional stability. Placing the integration stage after the inverse divider stage has reduced compressor distortion, probably by improving the smoothness of the gain control signal. |
The Multiband Compressor
now uses the DSP accumulator to scale and sum each band output for fine
control over individual band levels.
Input gains are adjusted
for some pre-emphasis at low levels, and output levels are set for a reasonably
flat response at high levels.
Oct 04, 2013: These IIR filters have now been pipelined and modularized for faster execution, and neater code. This has produced some benefits:
Oct 08, 2013: The compressor code has now been rewritten into modular form. A single macro instruction repeats the compressor and noisegate code in each of the six stages. This makes the code easier to understand and upgrade.
Oct 11, 2013: The Multiband Compressor code now includes "Delayed Recovery", to reduce control ripple while speeding up recovery time. This increases loudness, and reduces distortion. Delayed recovery works by setting the compressor recovery time constant to infinity whenever a signal increase is detected. After a delay (inversely proportional to the frequency), the decay time constant progressively speeds up to rapidly adapt to the new audio level.
Dec 30, 2013: The filters used in the Multiband Compressor were inititally placed both before and after each compressor stage. They have now all been moved in front of the compressors. This should improve compressor action (increasing loudness) and reduce some compressor distortion products, by reducing out-of-band energy at the compressor input.
May 08, 2014: Tests are being conducted to evaluate subjective audio quality using non-flat (spectral skewed) output from the multiband compressor. This may reduce bass response by between 1 and 6 dB, and increase treble.
Sep 20, 2014: The spectral skewing has been assisted by a following shelf filter. This can dramatically increase quality by reducing bass distortion in the clipper. Using a shelf filter reduces problems with filter leakage in the multiband compressor due to widely varying band output level settings required for EQ correction.
Oct 16, 2014: The spectral skewing is now assisted by a following -10 dB 300 Hz peak filter (notch). This increases quality by reducing bass distortion in the clipper at moderate clipping levels.
Sep 23, 2016: The Mode 4 spectral skewing has been removed. Mode 4 is now optimized for 3kHz bandwidth use. Band 1 level has been reduced 7dB to keep the voice fundamental at a similar level to the higher bands. Since band 1 has only a single voice frequency present, all the power is concentrated on one frequency - causing it to be out-of-proportion if adjusted for flatness on white noise (like Mode 5 is). Compressor gain on band 4 and band 5 has been reduced 6dB to improve voice quality in 3kHz bandwidth.
Sep 23, 2016: In Mode 5, band 4 and band 5 have had their compression gains reduced 3dB to improve voice quality.
Nov 02, 2016: Compressor timing modified to improve performance.
Nov 15, 2016: Microphone Flatness adjustment added, to trim the gains on band 5 and 6 to compensate non-flat microphones.
Per-band noise gate
Downward expands the compressor
output below a preset threshold, to reduce background noise.
The noise gate also removes
IIR filter noise, which is noticeable when the multiband compressor is
active.
Currently the noise thresholds
are preset in software. If possible, they will be made automatic.
The noise gating is limited
to about 20dB. This helps prevent gating artifacts, and also helps the
other station to hear when you are still transmitting.
Shaping filter
Modifies the response going
into the output compressor to provide EQ or filtering. Implemented as a
2nd order biquad, allowing a variety of IIR filter types to be used. Shaping
the spectrum going into the output compressor can increase quality by reducing
unwanted distortion. Using a separate filter to perform this EQ avoids
band leakage problems from excessive scaling of the multiband compressor
outputs. The shaping filter is now only used in Mode 2.
Oct 16, 2014: This filter was a -10dB peak (notch) at 300 Hz. When combined with the multiband compressor output level EQ, this produces a dip in the voice energy around 300 Hz. This reduces some very obvious bass clipping distortion in the region 300 to 600 Hz, resulting in better sounding audio at moderate clipping levels. At high clipping levels, the results improve with a flat multiband output. This filter is only used in mode 2.
Feb 18, 2016: This filter is now a 500Hz highpass 3dB shelf filter. This produces less clipping under 500Hz to reduce bass distortion.
Sep 23, 2016: Shaping filter is now only used in Mode 2. It is now disabled in Mode 4. Mode 4 is now optimized for 3kHz bandwidth audio.
Hilbert Transform filter
The Hilbert Transform filter
adds a 90 degree phase shift to the entire audio spectrum, generating a
Q (Quadrature) channel, from the I (In-phase) input. This enables accurate
measurement of audio levels and helps avoid aliasing distortion from non-linear
processes causing beats between audio harmonics and the sample rate. As
this doubles the workload of the following processes, it was placed here
instead of earlier in the signal chain.
Look-ahead output compressor
Makes up for variations
in level due to the multiband compressor outputs adding in random phases.
Boosts loudness. Increases average power. Gives the impression of more
bass. Provides a more constant drive level to the Hilbert clipping stage.
Produces a very well controlled output level. Uses a 1.45mS look-ahead
buffer. This compressor now has dual time constants to deal with fast peaks
and slower average signal variations simultaneously ("Virtual clipping").
The gain control signal is now lowpass filtered to reduce audible distortion.
Limiting action is shown
by lighting the last orange LED (LED 7).
Has a slower attack time
than other compressors to improve loudness, and reduce compression artifacts.
Uses Look-ahead peak
vector sum computation of the I and Q channels to compute the signal magnitude.
Includes Delayed/Adaptive
Recovery to allow a faster recovery time while avoiding control ripple
distortion.
Delayed recovery works
by setting the compressor recovery time constant to infinity whenever a
signal increase is detected. After a set time delay, the decay time constant
starts to recover.
Adaptive recovery speeds
up the compressor recovery until another peak is detected. This makes the
compressors progressively speed up to adapt to the new audio level.
NEW
"Peak stretching" added to level detector to improve control sensitivity
to fast signal peaks.
NEW
"Virtual clipping" added to improve peak-to-average ratio without creating
excessive distortion. This adds a second fast time constant in parallel
with the normal compressor time constant, to deal with fast peaks.
NEW
Control signal lowpass filtering added to slow down gain changes and reduce
distortion.
"Virtual clipping" is
now disabled when Hilbert clipping is enabled.
"Virtual clipping" level
is now adjustable via Select menu "c"
(Global setting = affects all modes). Adjustable from 0 to 6dB. Level is
boosted 6dB more on Mode 6 and 12dB more on Mode 7.
Oct 29, 2014: The Output Compressor now has a bypass mode in the Select menu. When active, it feeds the Multiband Clipper from the Multiband Compressor directly. This changes the loudness/distortion performance. Peak clipping level increases, but average clipping level decreases.
Aug 29, 2014: Fast RMS level detection has now been added. This is the same routine used in the Hilbert clippers. Removed, due to processing order changes.
May 22, 2015: A noise gate has been added to the Output Compressor, to improve noisegating performance further.
Nov 01, 2016: The compressor structure has been updated to use the vector sum of the I and Q channels to improve accuracy. This is important when Hilbert clipping is disabled, to still provide good SSB power control.
Nov 02, 2016: Compressor parameters modified to improve performance.
Nov 05, 2016: "Peak stretcher" added. "Virtual clipping" added. Control signal lowpass filtering and matching audio delay added. Latency reduced.
Nov 06, 2016: "Virtual clipping" is now disabled when Hilbert clipping is enabled. When Hilbert clipping is disabled, Virtual clipping level is boosted 6dB in Mode 6 and 7. Control signal lowpass filtering reduced to 500Hz for lower distortion.
Nov 15, 2016: "Virtual
clipping" now boosted by 12dB in Mode 7.
EQ sidechain
Fixed lowpass EQ on the
compressor level sensing input reduces compression on high frequency signals.
This improves loudness, especially with large amounts of pre-emphasis.
It also reduces level "pumping" or "flutter" of low frequencies by strongly
emphasised high frequency voice components. Makes the high frequencies
clip harder in the Hilbert Clipper. Only enabled when Hilbert clipping
is enabled.
Nov 05, 2014: The EQ sidechain is now disabled if Hilbert Clipping is disabled, to prevent overshoots.
Oct 04, 2014: The EQ sidechain now includes a mix setting to increase compressor sensitivity to low frequencies when the shaping filter is active, reducing low frequency clipping for improved quality. This is only useful on modes 2 and 4, as they are the only modes using the shaping filter. Obsolete.
July 07, 2015: The EQ sidechain now uses a biquad shelf filter for more predictable response. Currently, it is a -3dB 600Hz high shelf. This causes frequencies above 600Hz to clip up to 3dB harder than frequencies below 600Hz. This appears to produce a cleaner processed sound.
Nov 15, 2016: Output compressor
envelope (Hilbert clipping off, virtual clipping active, Mode 5) - Average
power has been greatly increased.
Clipping is used after
the compressors to increase the average power, while decreasing peak levels.
Larger amounts of clipping
produce a louder signal, but increase distortion.
Three techniques are
used to allow higher clipping levels, while keeping distortion lower:
The vector sum calculation is the same math technique used for finding the perimeter of a circle from a central point. The I & Q channels describe a sinewave as a rotating vector. The Hilbert Clipper works to limit the radius of the vector which equates to the signal amplitude. All real signals can be represented as a combination of sinewaves, so the process works for all waveforms.
The vector sum computation is a fast approximation that produces better than -30 dB average error. Suppresses harmonic generation better than 30 dB at high frequencies. At low frequencies, harmonic distortion is reduced further by using peak-hold and zero-crossing reset techniques.
Version 1 of the DSP Speech Processor used a fast audio compressor that had its level control synchronized to the waveform zero crossings. This allowed it to maximize the waveform half-cycles while keeping harmonic distortion levels low. A similar approach is applied to the Hilbert Clippers to reduce harmonic distortion from imperfect Hilbert Transforms and vector sum computations. A peak-hold routine is added to the magnitude estimation (vector sum) output. The peak-hold value is reset to the current magnitude output value at each zero crossing.
Oct 14, 2013: The Hilbert Clippers have now been modified to use peak-hold and zero-crossing reset. This reduces low frequency harmonic distortion by an additional 20 dB or more, without significantly compromising limiting effectiveness. This creates a limiter with zero attack and recovery time, and low harmonic distortion and aliasing. Produces higher average power levels on SSB.
A Multiband Hilbert Clipper clips the audio in two separate frequency ranges. The clipper outputs are combined by a matrixing process. This restricts the bandwidth of each clipper to reduce distortion, and simultaneously allows both bands to reach nearly full output. Methods to further reduce distortion are being investigated.
Allows higher clipping
levels while maintaining good quality. Audio sounds strong and clear.
Appears to have good
peak control.
Sep 23, 2016: The Multiband Hilbert clipper now uses a fixed crossover frequency of 2kHz in all modes and bandwidths.
Nov 15, 2014: Output envelope
- Mode 5. Updated. "The".
Nov 15, 2014: Output waveform
- Mode 5. Updated. "E".
Oct 23: Output waveform
- Mode 7 (Narrow DX).
Output filtering and transceiver
EQ
Cleans up some high frequency
IMD from the Hilbert Clipper, and provides high & low frequency boost
to help compensate for transceiver filtering. Running an outboard speech
processor is always a compromise, as the accurately controlled output level
then goes through the transceiver filtering, altering the frequency and
phase response of the nicely limited audio. The output EQ tries to compensate
for the bandpass effect of the transceiver audio and RF filtering. Eventually
it will be made adjustable. This digital process is assisted by the hardware
EQ that adds a fixed amount of boost at low frequencies. This helps improve
the dynamic range of the DAC, and helps avoid low frequency digital clipping.
Oct 06: The two IIR filters used for EQ have both been upgraded to the new pipelined IIR code. The bass EQ filter uses the 32-bit version for lower noise.
Oct 29: A separate EQ mode has been added for AM use. It is switchable via the Select menu. At this time it is not adjustable. OBSOLETE.
May 06: Output EQ modes expanded. Choices are Disabled, SSB1, SSB2, AM. Disabled has higher output level, as it needs no headroom. This selection will be expanded further.
Output gain compensation
This switches audio levels
to compensate for different filter gains and processing levels, to maintain
constant peak output.
DDS test tones
Test tones are useful for
testing levels and distortion performance.
At this stage, levels are only approximately set to -6 dBFS unless noted otherwise.
An assortment of tones are
available + white noise:
Single tone sinewave:
For
testing CW power on SSB.
2-tone sinewave:
For
measuring IMD with a spectrum analyzer. Changed
to 2 kHz separation 21/07/2014.
Triangle modulated sinewave:
For
checking transmitter linearity with a scope. Distortion is far more visually
obvious on this than on a 2-tone waveform.
Swept tone flatness test:
For
checking output EQ matching to transceiver. Level is about 6dB below limiter
output.
Pulsed sinewave tonebursts:
For testing transmitter tuning without overheating. 5 cycle bursts of 1
kHz sinewaves, 5 mS long, 50 mS apart. 10% duty cycle.
Impulse response test signal:
Single sample impulses, used for testing transceiver amplitude and phase
response.
White noise:
For
testing frequency response using a spectrum analyzer.
* All of these test tones
are sent through the DSP digital EQ (if enabled) and the analog EQ stages,
to compensate for transceiver filtering.
Self-test mode
Uses the DDS and white noise
routines to generate stepped sequences of tones and noise. Feeds the tones
and noise into the processor input,
for evaluating processing performance. Generates seven frequencies that
are carefully chosen to minimize DDS spurs. Roughly: 86, 172, 344, 689,
1378, 2756 and 4136 Hz. Steps down through four levels in 10 dB steps,
1 second each for tone : 5 seconds each for white noise. Includes settings
to freeze the current tone or noise output.
DDS distortion and spurs were initially higher than expected at -69 dBFS (3rd Harmonic of 86Hz), but this has now been improved to -82 dBFS by using a quadrature combining technique [16/08/2014]. The improved test signals make distortion measurements more accurate, because the processor's pre-emphasis and multiband compression amplify harmonics and spurii. The sinewave source may eventually be updated to an even lower distortion version, such as a DSP phase-shift oscillator.
* Self-test mode is designed for testing the DSP compressors and clippers, not as a general purpose audio generator.
Roger Beep (future
option)
A Roger Beep produces a
short tone to indicate end-of-transmission. When enabled, the PTT line
is kept on for a short time after manual PTT release, and an audio tone
is sent to the transceiver. Single tone, multi-tone or modulated tone outputs
are possible. Morse code is also possible, such as the letter "K" -.- indicating
"invitation to transmit". The delay is typically about 250 mS to 1 S.
S/PDIF over TOSLINK (optical
digital audio output)
The S/PDIF output is sent
using the dsPIC DCI (Data Converter Interface) 16-bit shift register. The
shift register is clocked by the divided down CPU clock to produce the
correct frequency S/PDIF bit clock. This requires a CPU clock other than
the standard 40 MHz. The bit clock is now provided via Timer3 OC3, transferred
to the DCI via pin 11 (RP4). This allows a wide choice of divide ratios.
The DCI interface is run in DMA mode, to reduce CPU usage.
The audio is encoded and
formatted into BMC (Biphase Mark Coding) using a 256 entry lookup table.
This is very fast. BMC encoding generates two bits out for each bit in.
A 16 bit word becomes 32 bits long after coding.
The S/PDIF preambles (sync
headers), channel status bits, and parity bits are added, and the data
is written directly into the DMA buffer in "ping-pong" mode. This method
saves over 3% CPU time compared to the previous double buffering scheme.
No antialiasing is performed on the upsampled data, to reduce CPU load.
If recorded at the original sample rate of 11.025 kHz, the alias frequencies are automatically removed. Alternatively, the audio can be recorded at 44.1 kHz, and resampled without filtering to 11.025 kHz, as there is no content above 5.5 kHz to cause aliasing. The TOSLINK output now features EQ to improve the sound quality, so it no longer has accurate peak control.
An interesting observation about the S/PDIF format is that the even parity and BMC coding always results in the last BMC parity bit being a logic 0. This means the signal polarity never changes, as can be observed on an oscilloscope. This also means the parity doesn't need to be calculated. Instead, the first BMC parity bit can just be made to compliment the preceding BMC bit! This further speeds up encoding.
The S/PDIF output is proving invaluable for testing audio processing performance.
June 25, 2015: Main CPU clock speed has been dropped back slightly to decrease S/PDIF clock speed to fix an audio glitching problem when feeding a C-Media USB sound device. These glitches occurred despite the S/PDIF clock being within 1% of the correct value.
July 06, 2015: The S/PDIF monitor output and headphone output now have lowpass shelf filtering added to improve sound quality. Currently the filtering consists of a 500Hz -4dB high shelf, followed by a second order 4.5kHz lowpass filter.
November 15, 2016: The S/PDIF monitor and headphone output lowpass shelf filter has been disabled, to make audio testing easier during firmware development.
PTT state filtering and
click suppression (level ramping) (added
11/06/2015)
The DSP Accumulator is used
as an integrator to count up if the PTT is activated, and down if it is
not activated. The Accumulator saturation function limits the values and
prevents overflow. When the accumulated value is positive the unit switches
to transmit mode. When the value is negative the unit switches to receive
mode. The value is also used as a multiplier to fade the transmit and receive
audio. This neatly filters the PTT action, and provides click suppression
at the same time producing very smooth switching. The fade period is about
23mS.
Transmit timer and Watchdog
timer (future options)
Since the PTT line is controlled
by the CPU, a transmit mode timeout is a wise option. A software timer
keeps track of how long the unit has been in transmit mode. If no audio
is present, the timer counts faster.
After a set time, the PTT
output is temporarily disabled to shut off the transmitter. Releasing the
PTT switch resets the timer.
In over two years of operation, the functional software has never locked up in transmit mode, despite some serious bugs.
A watchdog timer keeps track
of whether the CPU is executing code. If the CPU locks up for any reason,
the watchdog timer times out, and the CPU is reset. The CPU then starts
again normally. This is a safeguard against malfunction due to ESD, intense
RF interference or power supply glitches that could cause CPU errors.
Receive Mode
Input overload is indicated by lighting the red LED (LED 8 - the last one). This means the radio volume level is too high, and should be reduced.
FIR oversampling filters (as above)
DC blocking (as above) [Replaces IIR highpass filter - DC blocking has superior overload performance during impulse noise.]
Receive EQ
Typical old style SSB radios
have a steep drop in audio response below about 400 Hz in SSB mode, due
to the crystal IF filter response. This can be corrected to some degree
by low frequency boost. The required amount of boost is very high - over
16 dB. On AM or FM mode this boost must be disabled, or greatly reduced.
Nov 08, 2014: Low frequency EQ boost significantly flattens the receive frequency response on a typical transceiver. This improves the perceived quality of received audio, and allows much better readability at lower volume settings with typical household ambient noise levels.
Nov 08, 2014: This IIR biquad filter can be programmed with a variety of response curves. Currently, it is a 120 Hz peak filter with a Q of 1.2 and a gain of 20 dB.
Noise Limiter (future
option)
A Hilbert Clipper could
be placed here to act as a noise limiter. Since a Hilbert Clipper produces
minimal harmonic distortion, it will sound better than a traditional audio
noise limiter (more like an IF clipper).
Will help protect the Rx
AGC (Volume Limiter) from impulse noise. Any distortion produced by this
stage will be reduced by the LMS Denoiser, when active. Clipping will be
indicated by lighting one of the front panel LEDs.
Phase Rotator (future
option)
It may be worth adding a
Phase Rotator after the Noise Limiter, to disperse noise pulses after limiting
to lower their peak level.
LMS Denoiser
Based on an "Adaptive predictor",
this filter reduces random noise on the signal by adapting to pass the
frequencies in the signal with the greatest power. LMS stands for "Least
Mean Squares", which is the adaption method used. It has three adjustments:
delay,
beta
(error
gain) and leak (coefficient decay). The standard LMS design is modified
by controlling the beta value and audio input level in an AGC loop,
to reduce clipping caused by excessive enhancement.
This AGC action is indicated by lighting the first orange LED (LED 6).
The output is taken from
y(n).
Rx AGC (Volume limiter)
A low gain audio compressor
with adaptable recovery time, allows weak signals to be heard more easily
and prevents blasting on strong signals. Using "Delayed Recovery" provides
rapid recovery from audio peaks and noise impulses, while keeping distortion
levels low.
This AGC action is indicated
by lighting the last orange LED (LED 7).
Configuration saving
To avoid the need for resetting
levels each time the processor is powered up, the settings can now be saved
into Flash memory.
On startup, the Flash memory is scanned for the start of the data block. The start is marked by the number 12345. The starting address is then saved in RAM for later access, and the data is read into RAM. During save operations, a simple wear levelling scheme adds an offset to the starting address, incrementing the page of Flash that the settings are saved to each time. After the new page is written, the old page is erased. Bounds checking sets the page back to the start of free Flash when the last block is reached. At this stage no verify is done, but this may be added later.
The dsPIC33FJ64GP802 has a specified endurance of more than 10,000 erase/write cycles. Together with the wear levelling that spreads the writes over about 30 Flash memory pages, this should allow more than 300,000 saves before device failure.
The DSPIC33FJ128GP802 can
be used instead, and has twice the FLASH memory. This would extend the
FLASH endurance, and allow more complex firmware to be loaded for future
updates.
Currently, these settings are saved:
Global settings: (always
saved regardless of mode)
Receive EQ (bass boost).
Utility mode (narrowband
settings).
Input level.
Output Level.
Phase Rotator settings.
Microphone Flatness setting.
Output compressor on/off.
Hilbert clipper on/off.
Output EQ setting.
Default startup mode.
Virtual clipping level.
Settings saved individually
for each mode:
Input EQ setting (pre-emphasis).
Multiband gain settings.
Currently there is no way to adjust this setting.
Multiband level settings.
Currently there is no way to adjust this setting.
Output compressor gain setting.
Hilbert clipper drive level.
During firmware updates,
all settings will revert back to the defaults.
Current Hardware Problems and fixes:
ToDo List:
HARDWARE
Tx output level (R43/R45).
Rx input level (R25/R26).
These
resistor values also affect receive input common-mode rejection.
Tx analog EQ freq (C31).
Tx analog EQ shelving (R30).
SOFTWARE
LED dimming function bright/dim/dynamic
-
Manual bright/dim working 23/06/2013.
Save user settings to Flash
memory.
Load user settings from
Flash memory.
Reset default user settings.
Transmit
Eight audio processing levels
0-7. (Bypass, Singleband, Multiband Minimal... through Narrow DX.)
Analog AGC hang time.
Analog AGC freeze threshold.
HF boost EQ on/off/slope
adjustment. - Slope adjustment added 20/06/2013. - Now only used on modes
1 & 2. OBSOLETE.
Dynamic pre-emphasis EQ
adjustment. - Added 10/07/2013.
Phase Rotator on/off. -
Added 24/08/2013.
Phase Rotator centre frequency
adjustment. - Presets added 20/09/2014..
Multiband compressor on/off.
- Off in modes 0, 1 and 2. On in modes 3, 4, 5, 6, 7.
Compression gain adjustment.
Adjusts gain on the multiband or output compressors on modes 1 through
7. Added 02/05/2014..
Six bands of multiband compressor
EQ gain adjustment. - Implemented via mode
presets.
Microphone Flatness setting
- scales gain on Bands 5 and 6.
Six bands of multiband compressor
recovery time adjustment. - No longer required since Delayed Recovery has
been implemented.
Six bands of noise gating threshold adjustment.
Will
be made automatic if possible.
Six bands of noise gating recovery time adjustment.
Output compressor on/off.
Added 29/10/2013.
Output compressor gain (post-multiband
compression). - Implemented via modes, and Input
level adjust setting.
Output compressor recovery
time adjustment. - No longer required since Delayed Recovery has been implemented.
Hilbert clipper on/off.
Added 07/07/2013. Works on modes 1 to 5.
Hilbert clipping level.
1 = HF - Added 24/09/2013.
Hilbert clipping level.
2 = LF - Added 24/09/2013. [Disabled] LF clip level is a fixed amount above
HF clip level for best results.
Tx digital EQ bypass. Added
21/03/2014.
Tx digital EQ mode setting.
Added 21/03/2014.
Tx digital EQ LF peak frequency.
Tx digital EQ LF gain.
Tx digital EQ HF peak frequency.
Tx digital EQ HF gain.
Tx output level - Added
19/06/2013.
Tx headphone monitor on/off.
Alignment tones: Single
tone, 2-tone, triangle modulated sinewave, pulsed sinewave and swept sinewave
for linearity, EQ and level tests + psudo white noise.
Debug mode - allows testing
of each processing stage to evaluate audio quality and identify problems.
Receive
Noise Reduction on/off.
(LMS adaptive filter.) Added 21/06/2013.
Noise Reduction "delay".
Added 21/06/2013.
Noise Reduction "beta".
(Adaptation gain.) Added 21/06/2013.
Noise Reduction "leak".
(Decay factor.) Added 21/06/2013.
Audio AGC on/off. (Volume
limiter.)
Receive audio level. (Volume.)
- This will also affect the analog Tape/Headphone output level. (TOSLINK
S/PDIF digital output is unaffected.)
DISPLAY Information
7-segment display. - Current
processing mode 0-7, plus tones: 8, 9, A, b, c, + white noise: d.
7-segment display. - Menu
state/options (Alphanumeric codes and graphics).
Modes are shown below.
Decimal point. - Keypress
indicator.
LED multistage limiter display.
LED audio level/adjustment
level bargraph.
Red LED Hilbert clipping
indicator (Tx).
Red LED Input overload indicator
(Rx) Added 16/06/2013. For consistency, this will be moved to the Tx/Rx
indicator.
Green/Red power LED Rx/Tx
indicator + Analog AGC limiting indicator (Yellow).
LED Bargraph:
LED 0 = Pre-emphasis
Limiter.
LED 1 = Band 1.
LED 2 = Band 2.
LED 3 = Band 3.
LED 4 = Band 4.
LED 5 = Band 5.
LED 6 = Band 6.
LED 7 = Output Compressor.
LED 8 = Hilbert Clipper.
KEYPAD FUNCTIONS: (left
to right)
Button 1 = Normal mode.
(Resets functions to default starting positions, also resets analog input
AGC to maximum gain.)
Button 2 = Select - Tx default
is 0 (mode number), Rx default is 1 (volume). This is for convenience.
Debug overrides both.
Button 3 = "-" minus
Decrements selected setting.
Button 4 = "+" plus
Increments selected setting.
*UPDATED 25/11/2016*
0
= Bypass - Unprocessed. Analog AGC only. Preserves input quality. Analog
output EQ still on. For testing or feeding from external input for replays
etc.
1
= Singleband, flat EQ. Multiband off, everything else on. No noise gating.
Maintains spectral balance of input. For equalized inputs only, or manual
EQ adjustment.
Not suitable for normal
microphone input.
2
= Singleband, voice EQ. Multiband off, everything else on. Maintains spectral
balance of input, apart from Dynamic Pre-emphasis and shaping filter.
3
= Multiband, flat EQ. Good quality, no pre-emphasis. For equalized inputs
only, or manual EQ adjustment. Not
suitable for normal microphone input.
4=
Multiband, voice EQ. Tuned for better flatness on voice. Mode 4 is now
optimized for 3kHz bandwidth use. UPDATED
23/09/2016.
5
= Multiband, voice EQ. Tuned for better flatness on white noise. Slightly
more bass on voice. Good loudness at increased clipping levels. Default
mode.
6
= Multiband, voice EQ.
DX mode.
3dB more Hilbert clipping. Still sounds OK but with some minor distortion.
Loud.
UPDATED
21/10/2016.
7
= Multiband 3kHz, voice EQ. Heavy DX mode.
6dB more Hilbert clipping, max bandwidth 60 Hz-3 kHz. Higher average power
than modes 4, 5 and 6. Very loud
with
good DX quality, but high distortion.
8
= Single tone DDS sinewave - 800Hz. Peak
level is -6.17 dBFS on S/PDIF date: 29/04/2014.
9
= Two-tone sinewave SSB IMD test - 1628.95Hz & 2628.56Hz. Peak
level is -6.88 dBFS on S/PDIF date: 29/04/2014. Frequencies updated 03/07/2014.
A
= Triangle modulated sinewave linearity test - ~2628.56Hz, with ~43Hz triangle.
Peak
level is -7.34 dBFS on S/PDIF date: 29/04/2014.
b
= Swept frequency DDS sinewave flatness test. Added 06/05/2014. Peak Level
is around -12dBFS 10/01/2016.
c
= Pulsed sinewave tonebursts - 5mS long, 50mS spacing, 10% duty. Added
18/05/2014. Peak level is around -6dBFS.
d
= Impulse response test signal. Added 25/11/2016. NEW.
This
test signal allows a transceiver frequency and phase response to be tested.
E
= White noise Added 01/07/2013.
Peak level
is about -4.35 dBFS on S/PDIF date: 29/04/2014.
Modes 6 and 7 are DX modes that have higher distortion than other modes. Due to improvements in processing, the lower modes are only about 1dB quieter than the DX modes, but have much higher quality.
Customized Processing.
Many of the processing stages
can be disabled, to customize the processing as required (although this
is not recommended).
Examples:
Single band compression
and pre-emphasis only: Mode 2 selected, Hilbert
clipper disabled.
Multiband compression and
pre-emphasis only:
Mode 4 selected, output
compressor disabled, Hilbert clipper disabled.
High quality, minimal processing:
Mode 2 selected, output compressor disabled, Hilbert clipper disabled.
(No peak control.)
High quality, minimal processing
but louder: Mode 2 selected, output compressor
enabled, Hilbert clipper disabled. (Good peak control using latest firmware.)
High quality, minimal processing
but louder still: Mode 5 selected, output
compressor enabled, Hilbert clipper disabled. (Good peak control using
latest firmware.)
Controllable stages:
Input EQ (dynamic pre-emphasis)
adjustable
(Adds brightness and clarity to audio.)
Phase rotator on/off
(Increases loudness by reducing peaks. Adds no harmonic or IM distortion.)
Multiband compressor off
= Mode 1 or 2, on = Mode 3 to 7 (Increases
loudness and clarity of audio. Adds no significant distortion, or artifacts.)
Output compressor on/off
(Keeps the clipper drive level more constant. Adds punch.) (On newest
firmware, has excellent peak control when Hilbert clipper is off.)
Hilbert clipper on/off
(Increases loudness by removing unwanted peaks from the audio. Only adds
IM distortion.)
Output EQ off/choose
(Helps to flatten the transceiver's transmit filtering response.)
Currently, these settings are saved:
Global settings: (always
saved regardless of mode)
Receive EQ (bass boost).
Utility mode (narrowband
settings).
Input level.
Output level.
Phase Rotator settings.
Microphone Flatness setting.
NEW
Output compressor on/off.
Hilbert clipper on/off.
Output EQ setting.
Default startup mode.
Virtual clipping level.
NEW
Settings saved individually
for each mode:
Input EQ setting (pre-emphasis).
Multiband gain settings.
Currently there is no way to adjust this setting.
Multiband level settings.
Currently there is no way to adjust this setting.
Output compressor gain setting.
Hilbert clipper drive level.
Updated 25/11/2016.
0 = Normal processor
output.
1 = 1st FIR antialias
filter output.
2 = 2nd stage FIR
antialias filter output.
3 = 3rd stage FIR
antialias filter output.
4 = DC blocker output.
5 = Dynamic pre-emphasis
output.
6 = Phase Rotator
output.
* Most of the filter monitoring
points have been deleted to save CPU time - they no longer function.
7 = Band 1 filter
1 HPF output.
8 = Band 1 filter
2 LPF output.
9 = Band 1 filter
3 HPF2 output.
10 = Band 1 filter 4 LPF2
output.
11 = Band 1 compressor output.
12 = Band 2 filter 1 HPF
output.
13 = Band 2 filter 2 LPF
output.
14 = Band 2 filter 3 HPF2
output.
15 = Band 2 filter 4 LPF2
output.
16 = Band 2 compressor output.
17 = Band 3 filter 1 HPF
output.
18 = Band 3 filter 2 LPF
output.
19 = Band 3 filter 3 HPF2
output.
20 = Band 3 filter 4 LPF2
output.
21 = Band 3 compressor output.
22 = Band 4 filter 1 HPF
output.
23 = Band 4 filter 2 LPF
output.
24 = Band 4 filter 3 HPF2
output.
25 = Band 4 filter 4 LPF2
output.
26 = Band 4 compressor output.
27 = Band 5 filter 1 HPF
output.
28 = Band 5 filter 2 LPF
output.
29 = Band 5 filter 3 HPF2
output.
30 = Band 5 filter 4 LPF2
output.
31 = Band 5 compressor output.
32 = Band 6 filter 1 HPF
output.
33 = Band 6 filter 2 LPF
output.
34 = Band 6 filter 3 HPF2
output.
35 = Band 6 filter 4 LPF2
output.
36 = Band 6 compressor output.
37 = Multiband summing output.
38 = spare.
39 = Stereo I & Q Hilbert
transform test on S/PDIF.
40 = Hilbert transform output
I.
41 = Hilbert transform output
Q.
42 = Stereo I & Q output
compressor test on S/PDIF.
43 = Output compressor output
I.
44 = Output compressor output
Q.
45 = Stereo I & Q Hilbert
clipper 1 test on S/PDIF.
46 = Hilbert clipper 1 output
I.
47 = Hilbert clipper 1 output
Q.
48 = Stereo I & Q Hilbert
clipper 2 test on S/PDIF.
** More levels are needed
here to test multiband clipper functions. Yet to be added.
LED Display boards 1 &
2 - Some values may need adjustment to improve LED brightness matching.
Bypass capacitor values
are not critical. Only two bypass capacitors were fitted to the prototype.
Caution: Since common-anode LEDs are used, (except for D100) any LED shorts to ground will cause LED failure. The latest Display PCB 2 has a small link that can be cut to insert a safety resistor in the 7-segment LED supply rail. This safety resistor has been omitted from later prototypes. The commercially made PCBs have very well controlled spacing that protects against short circuits when assembled.
If using an add-on
printer card, put the card's I/O address under "Programmer Connection"
"Advanced" "I/O Addr.".
The card used in this
example was a "Redchief" LPT COM1 COM2 serial port expansion card, with
LPT I/O address 0xE800. This card works well, as it has a good voltage
output and very high value pullup resistors allowing it to work with the
revision 1.2 circuit below.
If using standard
on-board peripherals, select the LPT number in "Port", instead.
Parallel Printer Port. (From Wikipedia.) |
The dsPIC needs to be powered up to use this programming method. If this circuit fails to communicate with the dsPIC, the port voltage might be a bit low. Try increasing R5 and R6 to 680 ohms or even 1k. These resistors need to be low enough in value to discharge the cable capacitance, and high enough in value to allow adequate voltage.
Some printer ports have low value pullup resistors that can upset the voltage levels on the Data line (3). These types of printer ports require buffering of the pin 10 Data In line (ACK) to prevent it pulling up the voltage level on the Data line, and to fully drive the Data In line. Using an LM311 has been proven to work even with troublesome printer ports. |
PICPgm Settings
For initial programming:
Select "Program Code Memory
(FLASH)".
Deselect "Program Data Memory
(EEPROM)".
Select "Program ID Locations".
Select "Program Configuration
Bits".
If Verify fails:
Deselect "Program ID Locations".
Deselect "Program Configuration
Bits".
For later updates:
Deselect "Program ID Locations".
Deselect "Program Configuration
Bits".
Configuration bits only need updating if the hardware configuration changes, which is very unlikely.
A common way to prevent this happening is to use a coupling transformer. The transformer allows differential current flow, but prevents common mode current flow.
But transformers have some problems:
The audio is attenuated by a voltage divider for two reasons:
Since a receive mode DSP input has been added, additional ground loops are possible. A differential input has been used in the Rx ADC preamp circuit to minimize this.
The ground loop cancellation circuit relies on a low-resistance connection to the transceiver microphone ground. A ferrite bead-on-lead has low DC resistance, and has been added to the microphone ground line for better RF filtering.
BMC is a simple two-frequency representation of binary data. A 1 is encoded as a 10 or 01 output, and a 0 is encoded as a 11 or 00 output. The polarity of the new output is the opposite of the previous last output bit. An 8 bit byte becomes a 16 bit word after BMC coding.
The audio is encoded by using a 256 word lookup table to convert to BMC. The data is then written to a dual DMA memory buffer for sending to the dsPIC DCI unit. The SPI unit could also work for this application, and may run at higher clock speeds. Since these are hardware shift registers, they can send high speed 16 bit serial data words with no additional CPU load.
Software encoding was chosen because the special "preamble" sync codes that S/PDIF uses are not in BMC format - which makes hardware encoding difficult. Commercial S/PDIF encoders exist, but they need a clock reference that is not easily available now that the dsPIC has been switched to the internal FRC clock.
Ideally, the S/PDIF would be at 11.025 kHz stereo, but most consumer devices will not recognize this sample rate. The S/PDIF output is instead upsampled (without antialias filtering) to 44.1 kHz stereo with good results. The USB sound device being used works well at this rate. The CPU is now being clocked at 39.5136 MHz, and the correct S/PDIF bit clock is generated by Timer3 Output Compare routed to the DCI serial clock input by setting both lines to use remappable pin RP4.
Since there wasn't room to fit a full size TOSLINK socket on the rear panel, a mini-TOSLINK output connector was built from a 3.5 mm socket and a red LED. It works very well. A mini-TOSLINK to TOSLINK cable connects the DSP unit to the S/PDIF optical input of a cheap (<$15) C-Media USB sound device.
At this stage, the dsPIC internal FRC clock appears to be stable enough for reliable S/PDIF / TOSLINK functioning, but clock frequency errors or drift will cause recorded audio to change pitch slightly.
Recordings are best done
at 11.025 kHz, so the recording system performs antialias filtering. Another
way is to record at 44.1 kHz, and resample to 11.025 kHz afterward. This
does not require antialias filtering, as there is no audio content above
5.5 kHz. The dsPIC software currently does not feature antialias filtering
on the S/PDIF resampling, to reduce cpu load. The transmit monitor output
now features some EQ to improve the sound quality, and no longer has accurate
peak control like the transceiver output does.
The DSP Speech Processor
needs several connectors to attach the I/O.
The microphone I/O is designed
around 8-pin Mini-DIN connectors.
Fly leads can be built to
adapt to any kind of microphone system.
Receive audio I/O is via
3.5 mm phone plugs.
An audio amplifier IC has been added to the board. Point-to-point wiring connects the amp to the Speaker socket. If speaker drive is not required, the audio power amp can be left out of circuit, and the Rx Out taken from the OpAmp, but this will disable the transmit muting hardware.
A front panel stereo headphone socket has been added to the PCB. It can also be used as a TAPE output for recording both sides of a QSO. The audio is also available via the digital optical TOSLINK output. The optical output has the advantage of being immune to RF and ground loop effects. It carries processed audio on the left channel, and unprocessed audio on the right channel - for both transmit and receive.
Right Mini-DIN (back view).
Microphone audio input.
PTT input.
Left Mini-DIN (back view).
Processed audio output.
PTT output.
PTT Rx switching is only required by some older
CB radios.
Rx audio in (3.5 mm).
Rx audio out (3.5 mm).
3.5 mm Socket Tech Drawing
- these were the slimmest 3.5mm sockets available anywhere. Known as Lumberg
1503-07:
Digital optical output (TOSLINK S/PDIF) located on Display PCB 1 (3.5 mm Mini-TOSLINK, built from an LED mounted behind a 3.5 mm socket).
DC Power (2.1 mm). A long shaft plug may be required due to rear panel clearances.
Bill
of materials (parts list) with component location grid (thanks to Frank
G0GSR)
Two different dsPICs can
be used in this design:
The SPDIP dsPIC33FJ64GP802-I/SP
can be purchased online from Microchip Direct (minimum order is 2). This
was the original design choice.
The SPDIP dsPIC33FJ128GP802-I/SP
costs slightly more (about $1 extra), and has twice the FLASH memory. This
could be useful for future firmware upgrades, and is compatible with the
original design.
DSPIC33FJ64GP802-I/SP
Lead Count:
28
Package Type:
SPDIP
Temp Range:
-40C to +85C
Packing Media:
Tube
http://www.microchipdirect.com/ProductSearch.aspx?keywords=DSPIC33FJ64GP802-I/SP
*OR*
DSPIC33FJ128GP802-I/SP
Lead Count:
28
Package Type:
SPDIP
Temp Range:
-40C to +85C
Packing Media:
Tube
http://www.microchipdirect.com/ProductSearch.aspx?keywords=DSPIC33FJ128GP802-I/SP
SM16126D SOIC-24 LED Driver:
http://www.ebay.com/itm/2pcs-16-channels-constant-current-LED-drivers-arduino-SM16126D-STP16CP0-TLC5926-/111902604117
Miniature electrolytic capacitors
are available here:
http://stores.ebay.com/CAPPRO/Electrolytic-Capacitors-/_i.html
Ferrite "Beads On Leads":
http://www.ebay.com/itm/50-Ni-Zn-Ferrite-Bead-Core-Lead-3-5x6-0mm-Taiwan-/140329107881
DC power socket:
http://www.ebay.com/itm/10pcs-DC-Power-Supply-Female-Jack-Socket-5-5-x-2-1mm-Barrel-Type-PCB-Mount-/180855002074
Miniature 3.5mm sockets (called
"Lumberg 1503-07"
sockets - widely available):
http://www.ebay.com/itm/10-Pcs-DIP-PCB-Mount-4-Pins-Female-3-5mm-Stereo-Audio-Jack-Socket-/321099207333
Alternative 8-pin Mini-DIN
sockets: * These have been checked, and
physically fit the PCB, though they have slightly different dimensions.
This supplier has cheaper postage.
http://www.ebay.com/itm/311323907000
The 8-pin mini-DIN sockets:
*
http://www.ebay.com/itm/5-Mini-DIN-Connector-Socket-Female-8pin-PCB-pin-2008-8-/140431326834
The 8-pin mini-DIN plugs:
*
http://www.ebay.com/itm/5pcs-Mini-DIN-Connector-Male-Plug-8-pin-1102-8-/140431341209
* It is important to purchase mini-DIN plugs and sockets that match the PCB pad outline. Connectors from other suppliers are not guaranteed to fit the PCB. Also, plugs and sockets bought from different suppliers may have differing connector pin configurations, and may not fit each other.
PCB mount right-angle pushbutton
switches:
http://www.ebay.com/itm/10-x-Tact-Switch-6-6mm-6-85mm-50mA-12V-DC-Right-Angle-/260528274819
7-Segment common anode white
LED display:
http://www.taydaelectronics.com/led-displays/7-segment-1-digit/led-display-7-segment-1-digit-0-56-inch-common-anode-super-white.html
AMS1117 1A 5V SMD Regulator
IC:
http://www.ebay.com/itm/10-pcs-AMS1117-5-0-5-0V-1A-Voltage-Regulator-SOT-223-/250725260822
AMS1117 1A 3.3V SMD Regulator
IC:
http://www.ebay.com/itm/10-pcs-AMS1117-3-3-3-3V-1A-Voltage-Regulator-SOT-223-/250742607708
1.35A through-hole Polyswitch devices:
http://www.ebay.com/itm/20pcs-RUEF135-1-35A-30V-PPTC-PolySwitch-Resettable-Fuse-/321412059105
1A SMD Polyswitch device:
http://www.ebay.com/itm/10Pcs-Polyswitch-SMT-SMD-Resettable-Fuses-1812-1A-/180640196871
Drill all the panel holes before rounding the panel. This provides the required mounting holes, and helps assure better alignment.
The template below allows the construction of a wooden jig. Only one pivot point is necessary. When the first end of the panel is rounded, undo the mounting screws and flip the panel over end-for-end instead of rotating it. This helps provide better left-right symmetry in the finished panel. Then fasten the panel again with mounting screws and round the other end.
Print this template at 600dpi
for correct scaling.
Dark grey window tint was applied to the front surface to improve LED contrast. This also hides any scratches on the polycarbonate. It may also be possible to use the adhesive window tint to hold button labelling in place. If acrylic sheet is used, never clean it with alcohol as this will discolour the material.
The optional SMD protective resistor on Display PCB 2 (marked "R") is best ignored.
Attach Display PCB 1 to Display PCB 2, making sure the PCB edge pads are aligned. Display PCB 2 should be vertically aligned with Display PCB 1 so that the top row of the 7-segment LED pins is just clear of the top edge of Display PCB 1. Tack solder Display PCB 2 to Display PCB 1 at the corner pads first, in case realignment is needed. Be careful not to stress the PCB edge pads, or they may break off the board making reconnection very difficult. Avoid dropping the boards at this stage, or the edge pads can break off! Also use a small amount of solder to bond parts of the large top pads of Display PCB 2 to the Display PCB reverse side for mechanical strength.
Display PCB Alignment:
PCB1
= Display PCB 1
A: Ideal alignment for 1.6
mm thick PCBs. 7-segment LED is mounted almost touching the box top, 3
mm LEDs have very little space. LED pins clear the PCB1 edge OK.
B: Actual alignment used
on the first prototype. 7-segment LED is mounted almost centrally. PCB1
is mounted slightly higher. 3 mm LEDs have a little more space. LED pins
clash with PCB edge, requiring a chamfer.
C: Ideal
alignment for 1.0 mm thick PCBs. 7-segment LED is mounted almost touching
the box top, 3 mm LEDs have a bit more space. LED pins clear the PCB1 edge
OK. Use this for PCB-260.
Using 1.0 mm thick PCB material increases the space above and below the 3 mm LEDs. This means the same design will work for 1.0 and 1.6 mm PCBs, as the 3 mm LED centre line is the same.
The commercially produced PCBs have very carefully controlled LED placement. Using 1.0mm PCBs (PCB260) they should mount like "C" above. The rear of Display PCB 1 is required to be vertically higher than the front, to enable sufficient separation of the 3.5 mm Rx In socket and the mini-TOSLINK socket. Sloping Display PCB 1 upwards slightly towards the rear allows for this.
Header pins are used in two areas, for CPU electrical connections and mechanical fixing. Gold plated pins are recommended to provide most reliable contact. Nickel plated pins were used on the first prototype, and became unreliable.
Some 2.54 mm header pins
and sockets connect the signal lines between Display PCB 1 and the Main
PCB:
Simpler PCB pin mountingThe best way is to mount some straight header pins on the main board, and the header socket strips on the Display board (shown below). This avoids the need for creating a customized header pin assembly from right angled pins. Instead, the mounting pins of the socket strip are bent flat to match the pad pattern for SMD mounting. This method has been tested, and works fine.
|
After the pins are installed, plug Display PCB 1 into the main PCB, taking care to align all the pins. Test how well the PCBs fit the enclosure. They should align well, with no conflicts. Display PCB 1 tilts up at the rear for correct front and rear alignment.
Once the alignment is good, solder the remaining edge contacts that connect Display PCB 1 and Display PCB 2. Also solder the mechanical bonding solder pads at the top of the boards.
Next, fit the other parts to the boards. Start with the main PCB, then move on to the Display PCB components. Most parts are marked on the overlay. More details below.
Some capacitors can be either through hole or SMD. SMD capacitors have better RF performance.
Be careful to install the SIP OpAmps around the right way - they are difficult to unsolder. Pin 1 is marked with a square pad and a square outline on the overlay. Vcc is pin 8.
Use machined pin socket strips as a socket for the dsPIC chip. Mount the socket strips before the other components around them.
The TDA2003 leads need to be straightened to fit the board. Use minimal solder on the IC pins, as the pads have close spacing. They may be a tight fit. The TDA2003 needs to be mounted with its epoxy body pressed down until it touches the PCB, so the heatsink tab will clear the top of the enclosure. It only just fits.
Solder in a copper heatsink
tab after fitting the IC, keeping the solder away from the IC lead pads.
The tab will need one mounting hole, aligned to the IC tab hole. The
tab needs to be the same height or slightly lower than the IC tab,
or it will hit the top of the enclosure. Use a copper tab. Do not attempt
to solder an aluminium heatsink tab, it will damage the PCB (aluminium
soldering requires special solder alloy with a high melting point).
The commercial PCBs do not require fixed wire jumpers, but there are four flying leads required. One is for the Rx ADC input, one for Headphone output, and two are for the speaker output. Mount the four flying leads last, after the other components. The speaker flying leads can both have a ferrite bead added to reduce RF effects, but this is optional.
The main DSP board can be constructed first, and powered up with Display PCB 1 disconnected. The unit will function OK with no display. Before inserting the dsPIC IC, power up the main board, and check the supply rails. They should be 3.3v at the dsPIC IC. Also test the 8.3V rail for the analog circuits. Then power down and insert the dsPIC. It can then be programmed.
IMPORTANT: Never remove or insert Display PCB 1 with power applied or LED damage can result, due to short circuits.
Pads have been provided for an SMD RF bypass capacitor to be fitted to the TDA2003 audio input, if required. Currently unused.
The Polyswitch device can be either a through-hole or SMD type. It is used to protect the PCB tracks from melting in case of a short on the 12V rail. A 1.35A 30V device has been used.
The electrolytic capacitors
must
be physically small enough to fit the available space. This is especially
important for values over 100 uF.
The smallest electrolytic
capacitors are 4 x 7 mm from CAPPRO on eBay.
Use the lowest voltage rating
suitable. e.g.: 16V for 12V bypass, 10V for 8V bypass, 10V or 6V for 3.3V
bypass, 10V for coupling, etc.
The circuit is DC isolated from the enclosure. There are some SMD pads on the tracks for capacitor placement. The main groundplane has a 0.5 mm spacing from the edge tracks.
The programming connector
is a 4-pin PCB header socket strip, fitted to the PCB underside using surface
mounting, and facing the front. This avoids the need to remove Display
PCB 1 to access the connector. It can then be accessed from the front after
removing the front panel, or after sliding the PCB assembly out from the
rear of the box. Glue the socket strip to the PCB with a dab of hot glue,
to prevent the pins flexing and breaking.
See below:
Note: The 4-pin header
socket does NOT align to the four resistors nearby - the right hand pin
connects to the PCB ground pad. The PCB
overlay correctly shows the pin locations, numbered 4, 3, 2, and 1.
The commercial PCB has this marking on the overlay, and also features plated
through holes to reinforce the pads.
Avoid overheating the pins when soldering or the plastic can melt - destroying the plug. Solder fast.
The outer jacket from some
RG-6 coax fits these connectors perfectly, and keeps the wiring tidy. A
dab of hot glue inside the plug shell halves acts a good strain relief.
It will melt when soldering the shell halves together, producing a good
bond to the RG-6 jacket.
Dec 31, 2015: C1 (was across R1) has now been removed from the circuit, as the DSP EQ has been modified to work better with a flat input.
If RF feedback persists,
add an RF choke of at least 1mH in series with the 2-wire output "Audio"
line, close to the mike. 1mH = 1 millihenry = 1000uH = Brown Black Red.
The input to the DSP Speech Processor is designed for Electret Condenser microphones. Dynamic microphones need more gain, and a lower input impedance. This circuit uses the phantom power supplied by R1 on the DSP board to run a one transistor amplifier. If Rx is used, the 4k7 resistor may need to be increased to boost the gain. Because the input of the amp loads the microphone, Rx needs to be higher than the microphone impedance.
* The 2n2 capacitors must be ceramic types, to be effective at RF suppression.
* If RF feedback persists, add an RF choke of at least 1mH in series with the "To DSP Mike input" line. 1mH = 1 millihenry = 1000uH = Brown Black Red.
* If this circuit is not
located at the microphone, an additional RF choke of at least 1mH may be
needed in the "Mike in" line, to suppress RF feedback. Place it between
Rx and the 1uF capacitor, or between the 1uF capacitor and the 2n2 capacitor.
An example is shown below:
Both the capacitor
and the RFC must be mounted close to the microphone.
1mH = 1 millihenry = 1000uH
= Brown Black Red.
Small value RF chokes (much
less than 1mH) will be of little use to reduce RF levels on the microphone.
If the RFC resonates with the 2.2nF capacitor at the radio frequency, it
will make the RF voltage at the mike higher instead of reducing
it!
The microphone cable shield
wire must connect to microphone ground. This is to ensure
good shielding against AC hum and RF.
Avoid using data cable for
microphone cable, as the microphone wire is not shielded from the other
wires. This causes capacitive coupling.
Do not connect microphone
shield wire to chassis ground. This can cause earth loop feedback, RF feedback
and AC hum pickup.
Do not short microphone
ground to chassis ground. This can cause earth loop feedback and RF feedback.
If RF feedback is still present
after installing effective microphone RF filtering, there is a problem
somewhere that must be fixed. See Troubleshooting.
DSP MIKE INPUT to MICROPHONE
The microphone cable must
be shielded, and the shield must connect to the DSP microphone input ground.
DSP microphone input ground is connected directly to PCB DC ground. It
is grounded for audio, RF and DC. Connecting the shield to microphone ground
prevents RF pickup, and AC hum pickup.
If the microphone cable has a separate ground wire and shield wire, they must be connected together at the processor. They can also be connected together at the microphone.
Do not connect the microphone shield wire to chassis ground. The DSP chassis ground is not DC grounded or audio grounded, and is not guaranteed to be RF grounded due to aluminium oxide and powder coating on the enclosure. Lack of grounding at audio frequencies will cause AC hum pickup. If the chassis has RF flowing on it, connecting the shield to the chassis could feed the RF directly into the microphone input via capacitive coupling through the cable. This can cause RF feedback.
Do not short microphone ground to chassis ground. Chassis ground is intentionally isolated from DC ground to prevent ground loops. Ground loops at the processor input will cause ground loop feedback (sounds just like RF feedback) due to the high processor gain. When the microphone ground is shorted to the chassis, this could happen at any time if the DSP box were to touch other grounded metalwork.
Do not use the DSP PTT input ground for a microphone ground or shield connection. It is only grounded via a 1k resistor, and will not be an effective ground for DC, audio or RF.
DSP MIKE OUTPUT to TRANSCEIVER
The DSP microphone output
feeds the audio into the transceiver microphone input. The DSP microphone
output ground connection must only connect to the transceiver
microphone socket audio ground pin. The DSP microphone output ground connection
must
remain isolated from the DSP PCB ground, and the chassis ground. Any connection
between these ground points can cause ground loop feedback (sounds like
RF feedback).
If the transceiver microphone socket has separate PTT grounds and audio grounds, use the audio ground only. The PTT ground pin may not share the same ground voltage as the transceiver microphone input stage, due to being connected to a different part of the transceiver PCB. This can cause ground loop feedback (sounds like RF feedback).
Do not short the DSP microphone output ground to DSP chassis ground. This can cause ground loop feedback if the DSP chassis becomes shorted to another ground.
Do not short the DSP microphone output ground to transceiver chassis ground. This can cause ground loop feedback if the chassis is DC or audio grounded via any other path.
Do not short the DSP microphone output ground to transceiver power ground. This will cause ground loop feedback by disabling the ground loop cancellation circuit.
Do not short the DSP microphone output ground to DSP PCB ground. This will cause ground loop feedback by disabling the ground loop cancellation circuit.
NOTES
These rules might seem excessive.
Sometimes, these rules can be broken and everything seems fine... until
something changes. For example, if the mike ground is connected to the
chassis ground of the DSP box, this of itself doesn't cause a problem.
But if the box touches or is connected to other grounded metalwork (such
as a metal bench, a station ground bus or a transceiver casing) suddenly
it will cause ground loop feedback. Having correct ground connections prevents
this from ever happening.
Because the DSP Speech Processor can have as much as 40dB gain on the microphone input, any signals caused by ground loop current or RF pickup will be greatly amplified. This causes problems that can range from slight distortion effects through to 100% feedback. It is important that the microphone shielding is correctly grounded to keep RF out of the microphone wiring. Even though the microphone and microphone input stage have RF lowpass filtering, there is a limited amount of RF rejection. At low frequencies this rejection is less than at higher frequencies. Strong RF pickup due to incorrect cable shielding can still cause RF feedback.
Another thing to be aware
of, is there are often different grounds used for different frequency ranges.
For example, standard practice in radio transceivers is to have the antenna
output ground connected to the chassis, and the negative power connection
used as PCB ground. But in many cases, these two grounds are isolated at
DC and connected at RF by only grounding the PCB via small capacitors.
For mobile radios, this is often done to prevent short circuits in case
the radio is used in a vehicle using positive chassis ground on the electrical
system. If the radio is manufactured with the PCB grounded to the chassis
at DC, this is usually only done in certain places on the circuit to prevent
ground loops due to the very high currents being used (often over 10A for
100W transceivers). The high currents cause voltage drops in the wiring
and PCB tracks (due to resistance) that have to be kept from affecting
sensitive inputs, (such as microphone inputs) that are operating in the
millivolt range. This is why transceiver microphone inputs are never grounded
to the chassis at DC and audio frequencies - although they are often grounded
at radio frequencies using RF bypass capacitors to help prevent RF from
entering via the microphone wiring.
Mini-DIN pinouts
INPUT
|
OUTPUT
|
To decrease DSP analog
output EQ (to suit transceivers with wider filters, or to reduce bass level
or bass distortion in some transceivers):
Change R31 to 10k to reduce EQ by 6dB.
Connect a 22pF capacitor
from U1b pin 6 to 7 to improve stability. This prevents OpAmp oscillation.
The output level will increase after this mod.
Reduce output level setting to compensate.
Increasing output level:
Scale R45 as needed to increase
level.
Some transceivers need
more audio drive. Change R45 to 22k for 6dB more output, or 10k for 12dB
more output. Do not reduce R45 more than necessary. Overdriving
the transceiver can cause distortion and splatter.
Keep R45 above 1k.
Changing the analog EQ
corner frequency:
Some transceivers have a
wider or flatter frequency response, and need a lower corner frequency
for the DSP analog EQ boost. The following table should help to calculate
the best value for C31. Supplied by Frank, G0GSR.
C31 | f+3dB |
68n | 477Hz |
100n | 322Hz |
330n | 99Hz |
560n | 57Hz |
U2a pin 1: 6.03V
U2b pin 7: 6.60V
Versions
prior to v5.1 are 4.51V
U1a pin 1: 5.64V
U1b pin 7: 5.86V
These voltages are not critical, but should be
near Vcc/2 (6V) for maximum OpAmp voltage range to avoid clipping.
If current consumption
is much higher than this, test for audio amp oscillation, a short circuit,
or a failed SMD regulator.
Audio amp oscillation
can be caused by: Poor connections, failed or poor quality components or
shorted output wiring.
Caution: The 8.3V
rail is supplied by a 5V regulator with its adjust pin connected to the
3.3V rail, which may prevent the 5V regulator overcurrent protection from
working. Avoid shorting the 8.3V rail!
The LED Display Board(s) - Contains a low-cost
3.3V SMD serial LED driver IC, a TDA2822 used as a full bridge LED driver
for the R/G LED, a TOSLINK digital audio output driver circuit, and assorted
dimming logic.
The green bargraph LEDs are superbright water-clear types to match the brightness of the other LEDs. They were made diffused by roughening the front surface with fine sandpaper.
A 3.5 mm TOSLINK adaptor was built from a 3mm red LED and a 3.5 mm socket.
Normal resistors were used to make construction easier. Some surface mount devices were used to save space and money. The header pins are standard right-angle types, modified to be surface mounted. The CAD process makes the boards fit together perfectly.
The two PCBs side-by-side.
The two PCBs fit together well, like a sandwich.
The back of Display PCB 1 is all groundplane, except for an isolation strip
near the front edge.
Triangle modulated sinewave being used to perform
a linearity test on a transceiver. A good result!
Connect a 4 to 8 ohm speaker to the DSP Speech Processor 3.5 mm speaker output (the socket further away from the DC Power socket). The TDA2003 audio amplifier IC can drive speakers down to 2 ohms, but the bass response will decrease due to the output coupling capacitor being 1000 uF.
Transceiver microphone fly leads will need to be made to suit the transceiver. Consult your transceiver schematic diagram for the microphone wiring. The transceiver microphone lead goes to the mini-DIN socket nearest the DC Power connector, and the input microphone lead goes to the mini-DIN socket furthest from the DC Power connector.
See Microphone
Wiring Diagram.
See Grounding.
Adjust the radio volume control so the last orange LED lights on the loudest voice or noise peaks. This is the point at which the DSP Receive AGC activates. Signals above this level will be compressed to prevent them exceeding the set volume level. The volume can be reduced further to avoid this AGC action if desired.
The DSP Speech Processor Receive volume setting can be adjusted by the "r" Select Menu. This is the default at power-on. At the time of writing, this DSP adjustment will be lost at power-off. At power-on, the unit will start at the default setting again.
If NR is activated via Select Menu "n", the audio level may reduce. If needed, increase the radio volume slightly until the speaker volume is at a comfortable level again. NR decreases random noise on the signal, and enhances cyclic content.
The NR adjustments are:
d
Delay: Adjusts the DSP delay between the audio input and the
LMS filter. Increasing delay makes the noise reduction more aggressive,
and increases audio artifacts.
G
Gain: Adjusts how closely the LMS filter attempts to follow
the signal. Increasing gain makes the signal louder and increases
audio artifacts.
L Leak:
Adjusts how fast the LMS filter response decays to zero. Increasing leak
improves noise reduction and increases audio artifacts.
=
EQ: Adjusts the EQ slope of the LMS audio input. Increasing
EQ
boosts
treble and cuts bass. Decreasing EQ boosts bass and cuts treble.
If the red LED lights at
any time, it indicates input ADC clipping. Reduce the radio volume until
the red LED does not light on signal peaks.
Audio can also be monitored via the S/PDIF output. If the S/PDIF is fed to a stereo amplifier, severe alias distortion will be heard, as the S/PDIF output does not currently feature antialias filtering. If S/PDIF audio is recorded using a sample rate of 11025 Hz, the alias frequencies above 5.5 kHz will be completely removed. The S/PDIF audio is the unprocessed (Right) output and processed (Left) output (no transceiver output EQ).
Transmit setup of the processor is best done while transmitting into a dummy load.
Switch PTT to transmit and speak normally into your microphone. The processor LEDs should light up to show each speech band being compressed. The first green LED (LED 0) will mostly light during sibilance ("S" sounds) or other high frequency sounds. The last orange LED (LED 7) will light most of the time, showing output compressor action. The red LED (LED 8) will light to show Hilbert clipper action.
Set the correct bandwidth to match the transceiver.
This is set using the Select menu "U" option.
At the time of writing, six settings are available:
Adjust the transceiver microphone gain for the desired ALC action. If the output EQ is well matched to the transceiver, it should be possible to obtain full PEP output at all voice frequencies with little or no ALC action.
If this is not possible, it likely indicates the DSP output EQ does not suit the transceiver. With the current design, this will usually mean the bass end of the audio spectrum is too low in level. Sometimes this can be improved by boosting the bass EQ by circuit adjustment, or DSP output EQ adjustment (limited selections are available at this time). Another method is to modify the transceiver audio response to be flatter towards the bass end of the spectrum, by increasing coupling capacitor values in the transceiver microphone amplifier circuit.
Transceiver SSB carrier offset frequencies should be checked for accuracy and corrected if errors are found. It is possible to improve the low frequency transmit response on SSB by increasing the audio path coupling capacitor values, and by careful tuning of the carrier offsets. This may degrade opposite sideband rejection slightly at low frequencies. It is not too difficult to obtain a reasonably flat SSB response down to 100Hz on a typical transceiver, using the SSB 2 EQ (default) and some careful carrier offset tuning (see image below). This is done using the white noise mode (main mode "d") while observing the signal on a low-cost SDR receiver. An RTL dongle works well on the higher bands (27/28MHz) for this purpose. The carrier is placed part way down the SSB filter curve, and finely adjusted for best passband flatness on white noise. Only a small vestige of opposite sideband energy is left close to the carrier (depends on filter response). If audio distortion is too high, increasing the transmit path RF gain after the balanced modulator can decrease distortion by lowering the audio drive requirement. This will reduce the carrier suppression by an equal amount, but with careful adjustments it can easily reach an acceptable limit. The best option for wideband audio on SSB might be to replace the SSB filter with a new unit having a wider response and/or steeper skirts, or even better still - use a DSP based SSB generator, or a DSP based transceiver.
The transceiver passband response can be checked by using the Mode "b" Swept tone flatness test, and an RF power meter or scope. This will display the combined response of the DSP output EQ, analog EQ, transceiver microphone amplifier and SSB filter. Ideally, the output power should be constant across the desired transmit passband. The white noise mode "d" can be used to check transmit passband flatness and opposite sideband rejection, by using an SDR receiver with a spectrum display. See image below.
If the DSP audio output level needs adjustment,
it can be performed as follows:
With the PTT down, and the processing Mode number
displayed, go to the Output Level setting in the Select Menu by pressing
the Select button (button 2) three times. The 7-segment LED should display
"o". The output level can then be increased by button 4 or decreased by
button 3. This setting can now be saved using the
"Programming Mode".
If the transceiver features an SSB RF clipper processor, the RF clipper can be used as a final limiting stage. Since an RF clipper has no methods to control in-passband distortion, it should be used at its lowest level for best quality (just barely clipping). The DSP then does the bulk of the processing, with the RF clipper providing final peak protection for the transmit stages by removing overshoots. Any other transceiver audio compression should be disabled, or reduced to minimum. If the transceiver does not feature an RF clipper, but instead only has an audio based processor/clipper, it is recommended to leave the transceiver processing disabled.
SSB white noise spectrum
on a typical CB transceiver using a 4kHz wide monolithic crystal filter.
The LSB passband is mostly flat with only a tiny amount of USB energy present.
Possible problems:
Audio break-up,
echoing distortion, scratchy noise or feedback (SSB) or feedback squeal
(AM).
Could be RF feedback, or
a ground loop.
Commercially made
PCB, underside:
Commercially made
PCB, Display PCB 1:
Commercially made
PCB, Display PCB 2 - front view (not to scale):
3mm or SMD (untested) LEDs can be used with
this panel. Safety resistor "R" is optional, and has a shorting link. It
can be ignored.
Overlay of main PCB - all resistors marked. Click
for full-size image.