EMRFD Message Archive 11348

Message Date From Subject
11348 2015-07-23 18:22:28 k1rf_digital_stev... Question on digital version of allpass filters


Hi all. In looking at the legendary single signal direct conversion receivers from R. Campbell, I always wondered if the analog allpass filters such as those discussed in EMRFD page 9.28 through 9.32 could be implemented via digital filters.  This would eliminate the problem of component tolerances.  The conventional way to do it digitally is to use finite impulse response (FIR) filters which implement the Hilbert transform. But I have seen a few papers in the literature that describe highly efficient mechanizations that can achieve excellent performance with much lower computation costs.  For example, I came across a paper entitled “A Simple Method for Sampling In-Phase and Quadrature Components” in IEEE Transactions on Aerospace and Electronic Systems Vol. AES-20, NO. 6 November 1984 by Charles M. Rader.  In this paper, the author describes an implementation based on a particular type of infinite impulse response (IIR) filter which require only one multiplication, one addition, and one subtraction for each of two filters at a sampling rate of 4 times the signal bandwidth to achieve about 0.1 degree phase accuracy between channels or about 60dB image rejection. This seems quite remarkable to me and opens the door to using very low cost processor chips to implement allpass filters for 90 degree IQ implementations.  Has anyone in this group come across any efficient digital allpass filter implementations? 

 

Thank you

 

“Digital Steve”, K1RF


11349 2015-07-23 19:43:17 Ashhar Farhan Re: Question on digital version of allpass filters
short answer is yes. the really long answer is the whole chapter on DSP by larkin in the emrfd.

- f

11350 2015-07-24 01:29:26 oh6eh Re: Question on digital version of allpass filters
Hi!

This might be interesting for you:
Hilbert transform « iki.fi/o

 



73,
Kaj  OH6EH


11351 2015-07-24 04:31:09 k1rf_digital_stev... Re: Question on digital version of allpass filters
Thank you.  Yes, that's  the basic concept.  The paper I referenced (though not so easy to get as you have to pay for it unless you have access to an IEEE library) shows a physical hardware implementation, which is very simple and easier to visualize than the equation version you gave me the link to.  There appears to be some magic in coming up with the coefficients for the filters.  The IEEE version got 60dB sideband suppression.  This type of filter appears to be used in the hifi audio field for audio effects or audio compensation effects but I have not seen it applied to ham radio IQ phase shifts
11352 2015-07-24 04:43:21 k1rf_digital_stev... Re: Question on digital version of allpass filters
Thanks Ashhar.  Well sort of.  This very informative DSP EMRFD section discusses implementing the Hilbert transform by using a FIR filter in one channel and a delay in the other; a standard way of doing it  It also talks about how an IIR filter works and lists a coding example. But I did not see anything about implementing allpass IIR filters.

"Digital Steve", K1RF
11353 2015-07-24 10:34:16 boblarkin02 Re: Question on digital version of allpass filters
Thanks for the reference, Steve.  This is different, and potentially interesting in all the ways you suggest. 

The IEEE likes to tie their archives to their income stream. This makes their published info a bit of a chore and a minor expense to obtain.  But, note that the info is pretty much in US patent 4794556 available on Google.

I am going to study this and hope to understand its potential better.  Steve, or anybody else that plays with this, please report your findings.

73, Bob  W7PUA
11356 2015-07-24 11:52:33 n.a.moseley Re: Question on digital version of allpass filters
Hi Steve and group,

I wouldn't bother with IIR allpass filters; regular FIR Hilbert transformers for HAM applications do not require many coefficients (i.e. multiplications and additions), are much easier to implement in fixed-point arithmetic than IIRs and the coefficients are far easier to obtain. Modern microcontrollers, such as an ARM Cortex M4, are fast enough (72 MHz or higher) to do the baseband processing required for AM/SSB and they cost less than $10 in single piece quantities.

To put things into perspective, I use an M4 running at 80 MHz in an underwater ultrasonic acoustic MODEM. The MODEM has a direct-conversion receiver architecture (I and Q) with 8kHz baseband bandwidth and includes mark/space detectors, timing synchronization, Reed-Solomon error correction and correlation-based packet time-of-arrival estimation. This takes about 50% of the CPU. It is programmed in C++ without using any exotic optimization tricks. An SSB/AM receiver is well within the real-time capabilities of an M4 or similar processor.

The main challenge in getting 60 dB of sideband suppression is not the digital part; the I/Q imbalance caused by amplitude and phase mismatches in the analog front-end (quadrature mixer, LO waveform and baseband amplifiers) will be the limiting factor. Luckily these imbalances can be easily compensated for in the digital part, either manually or automatically.

73,
Niels PA1DSP.

 

Thank you.  Yes, that's  the basic concept.  The paper I referenced (though not so easy to get as you have to pay for it unless you have access to an IEEE library) shows a physical hardware implementation, which is very simple and easier to visualize than the equation version you gave me the link to.  There appears to be some magic in coming up with the coefficients for the filters.  The IEEE version got 60dB sideband suppression.  This type of filter appears to be used in the hifi audio field for audio effects or audio compensation effects but I have not seen it applied to ham radio IQ phase shifts


11357 2015-07-24 12:08:53 Dana Myers Re: Question on digital version of allpass filters
11358 2015-07-24 12:25:40 n.a.moseley Re: Question on digital version of allpass filters

 

11359 2015-07-24 13:31:57 Alberto I2PHD Re: Question on digital version of allpass filters
11360 2015-07-24 14:58:21 k1rf_digital_stev... Re: Question on digital version of allpass filters
Hi Niels.  Yes, one can purchase high performing Arm type processors fairly inexpensively these days which can do FIR Hilbert transformers with one byte tied behing their backs, so to speak.  That said, it's still interesting to come across alternative algorithms that can do a job at the required performance level at lower hardware or software costs.  I just purchased a STM discovery board containing an ARM Cortex M7 processor, a 480x272 LCD-TFT with capacitive touch panel, and a slew of interfaces, A/D converters, and audio codec. It cost about $60 (part numberSTM32F746G-DISCO). I got a pointer to this from Alberto, I2PHD. I'm using it for a high performance general coverage receiver which has a 455KHz 2nd IF.  The ARM board will do the digital downconversi
11361 2015-07-24 23:04:19 Neil Martinsen-Bu... Re: Question on digital version of allpass filters
It is always amazing to find out that there are lots of other people thinking about the same things as you are! Ever since reading one of KK7B's papers where he says (paraphrasing) "everything after this point could be done by a computer", I have been thinking about trying to do just that. I admit that I read Chapter 11 and thought of trying to get into DSP programming, but there didn't seem to be an easy on-ramp for learning to develop in DSP assembler.  I'm only just barely smart enough to bang around in the Arduino development environment. Unfortunately, an Arduino doesn't have enough ADC or processing horsepower for even simple baseband DSP for the sideband rejection.

I was turned on to the Teensy 3.1 <https://www.pjrc.com/teensy/teensy31.html> which uses the Arduino IDE but has an ARM Cortex M4 with dual 12-bit ADCs, a single 12-bit DAC and can be clocked way up there for even lazy/stupid programmers like myself to fit their filters into the available headroom.  Paul Stoffregen, creator of the Teensy microcontrollers, has a very nice Audio library <https://github.com/PaulStoffregen/Audio> that includes FIR filtering at 44.1 kHz sample rate. That library doesn't (yet) support the Teensy 3.1's dual ADCs for stereo 12-bit input, but there is a bare ADC library for the Teensy <https://github.com/pedvide/ADC> that does support the dual ADCs. (If the Audio library supported stereo input, the coding involved would be almost trivial.)  The Teensyduino development environment must include the CMSIS DSP library since Paul uses it in his library.

I am in the "noodling" stage of a single-signal direct conversion receiver where the audio processing is done by the Teensy 3.1 as well as the rig interface functions.  I plan on using digital RF generation (AD9850, Si5351, Si570) which means I need a microcontroller anyway for the control functions and the Teensy 3.1 means that the same microcontroller can do the audio processing as well. I haven't decided on DBMs or QSD for the RF front end, but I'm leaning towards QSD since quadrature clocks are easy to make now that the Silicon Labs PLL chips go up past 150 MHz.

I'd love to hear from other people who have done this or are thinking of doing this, to share ideas and questions with. Niels PA1DSP in particular, if you would be willing to share your ARM FIR code, it would get me a lot closer than trying to plug together pieces of pre-existing libraries or (heaven forfend) writing my own.

-Neil N0FN

11364 2015-07-25 03:23:23 jorschei Re: Question on digital version of allpass filters

There is a ongoing interest to use powerful ARM processors as an receiver processing I&Q base band signals and demodulation the SSB and AM mode. If the ARM ADC can only handle the lower frequencies up to approximately  800 KHz an front mixer will increase the RX frequency.

I upload in the PE1KTH file a 74CBTLV3253 sampler mixer including the Si5351A clock generator as VFO. Also the schematic's of the PSoC5 set up as I&Q processor , band filter and demodulator. Good receiving results has been archived up to 30 MHz in combination with the PSoC5 from Cypress. The universal mixer can also be used for ARM configurations I think.

 See PAoRWE his site  http://home.kpn.nl/rw.engberts01/projects.htm.

Rob PAoRWE has done a lot off  PSoC5 programming and the building group here is preparing to test the Teensy 3.1 to set up an receiver in combination with the 74CBTLV3253- Si5351A front module. Schematic's in the PE1KTH file.

73' Joris PE!KTH

11367 2015-07-25 15:03:55 AD7ZU Re: Question on digital version of allpass filters
In the event one does not wish to write the real time software required to modulate / demodulate SSB or CW signals here is an alternative:
 
check the QF1D512  it is a 512 tap (32 bit coefficients, 24bit data) fir, operates on 3.3v at 11ma and will operate up to 500Khz.  Combined with a high grade audio codec 2 filters are all that is needed to perform the phase shift and baseband filtering.  For a quadrature filter the QF1D512 will be limited to 255 taps because the quadrature filter is not symmetric.  There is also a feature in the filter chips to select which incoming data stream is filtered allowing sideband selection without changing any hardware path and to use an averaging decimation function to improve the S/N of the incoming data
 
There is a filter designer application that is a free download from quickfilter, however it will not calculate the quadrature filter.  I designed my own filter designer and can easily import the data to the quickfilter designer to verify the performance.
 
The filters can be loaded with any ucontroller via a SPI interface. Beyond that there is no overhead.  An Attiny85 will work well all that is needed is sufficient flash space to hold the kernel data 255 coef. * 2 filters * 4bytes.  Quickfilter tech also has a reference design for a codec/attiny85/2 Qf1d512s
 
I have written a crude C code filter generator that will calculate the bandpass filter coefficients (windowed sinc) and windowing functions .. either Kaiser or Blackman-Harris. There is no nice windows interface but with the simple algorithms one could create an excel sheet to do the computations.

just a few more thoughts

Randy
AD7ZU


11369 2015-07-26 09:38:07 boblarkin02 Re: Question on digital version of allpass filters
I am way back on Steve's original question about the Rader sampler.  I am working from the 4,794,556 patent, and it may differ from the IEEE paper.  But, assuming not, Rader is only addressing the conversion of an I-F signal into its quadrature components.  As I read it, he is not addressing the Hilbert transform job of providing a wide-band 90 degree phase shift, required for USB/LSB demodulation (or modulation).

His method competes with the use of a pair of multipliers along with a computed Sin and Cosine.  He does not need these latter two computations, usually requiring a power series.  However, he does tie the sampling frequency to four times the I-F center frequency.  The x4 bears an interesting resemblance to various analog mixing schemes used for I-Q  generation.  But, in any event, in terms of usiing the I-F frequency for fine tuning, it adds some constraints.

Or does the other paper carry this further?

Bob  W7PUA
11370 2015-07-26 10:09:24 Steve Dick Re: Question on digital version of allpass filters
The patent is not at all the same as the referenced paper and does not present the same idea. I didn’t mention in my original post that the Rader paper “A Simple Method for Sampling In-Phase and Quadrature Components” in IEEE Transactions on Aerospace and Electronic Systems Vol. AES-20, NO. 6 November 1984 also does the digital downconversion by sampling at 4 times the IF bandwidth, then does the Hilbert transformer using a relatively simple IIR filter pair.  That implementation is extremely efficient and uses a small fraction of the multipliers required in a conventional FIR filter-based Hilbert transformer.  Worth reading that paper if you know someone in academia or industry that can get access to that paper.
 
“Digital Steve”, K1RF
 
11371 2015-07-26 14:49:30 n.a.moseley Re: sin/cos generation was: allpass filters.
 

His method competes with the use of a pair of multipliers along with a computed Sin and Cosine.  He does not need these latter two computations, usually requiring a power series.  However, he does tie the sampling frequency to four times the I-F center frequency.  The x4 bears an interesting resemblance to various analog mixing schemes used for I-Q  generation.  But, in any event, in terms of usiing the I-F frequency for fine tuning, it adds some constraints.


Or does the other paper carry this furthe r?

Bob  W7PUA


Hi Bob, all,

I got triggered by 'His method competes with the use of a pair of multipliers along with a computed Sin and Cosine.  He does not need these latter two computations, usually requiring a power series.' and made a blog post on efficient high-purity sin/cos generation. You can find it here: https://namoseley.wordpress.com/2015/07/26/sincos-generation-using-table-lookup-and-iterpolation/

The sin/cos algorithms are so efficient and the quadrature mixer is so versatile, the combination is very hard to beat.

73,
Niels.

11372 2015-07-26 18:25:12 Dan White Re: Question on digital version of allpass filters

A few years ago, Rick Lyons posted a nice summary of I/Q generation techniques, aka  "Analytic" signals, at DSP Related.

http://www.dsprelated.com/showarticle/153.php

Several theme and variations in there.  (Read the PDF version)

He mentions the Rader approach bud didn't include it as it's not linear phase.

Dan AD0CQ

11373 2015-07-27 04:17:59 k1rf_digital_stev... Re: Question on digital version of allpass filters
Nice summary article Dan. It's true that the Rader approach is not linear phase for a single IIR filter compared to FIR filters which are, but he quickly dismissed it without giving any real explanation of why it's not useable.  A critical point that he did not mention is that the I and Q output phase difference itself can be made very accurately with these filters, not the absolute phase of one of either of the two filters with few multiplies and more than adequate image rejection for amateur radio applications.  The non-linear phase of the individual IIR filters do not matter very much in this application and are relatively small. The paper discusses phase errors, which Rader states are believed to be negligible.

Regards
"Digital Steve", K1RF