Author Topic: Simple diy SDR radio with Tayloe mixer and STM32  (Read 84205 times)

0 Members and 1 Guest are viewing this topic.

Offline seriouscoinage

  • Contributor
  • Posts: 31
Re: Simple diy SDR radio with Tayloe mixer and STM32
« Reply #150 on: June 20, 2016, 09:58:52 am »
Image rejection is just under 50dB, using a sine wave from my signal generator. This isn't too bad, but could be better. I think the most obvious source of imbalance is the gain setting resistors for the inamps - they are just ordinary 1% resistors, and I made no effort to match them. This can easily be fixed in software though. (I tried checking the IQ correction checkbox in SDR Sharp, but it didn't seem to do anything.) I was able to make a crude active loop antenna, which I put up to my window, and I'm getting some more signals now. This circuit really wants a preselector - I am getting lots of signals on the 3rd harmonic of the LO frequency, and lots of AM broadcast breakthrough (this *might* actually be the active loop antenna, though.)
 

Offline Howardlong

  • Super Contributor
  • ***
  • Posts: 5319
  • Country: gb
Re: Simple diy SDR radio with Tayloe mixer and STM32
« Reply #151 on: June 20, 2016, 11:09:53 am »
50dB is very reasonable for most analogue quadrature mixers, there's probably not much point trying to polish that any more, environmental effects such as temperature will start to become significant.

I am pretty familiar with the way the IQ image correction works in SDR Sharp, I did some work with the author of the software as well as doing my own IQ correction algorithms. I can assure you that it isn't "easily fixed in software", it is actually quite complex to get it right. It is not solvable analytically, you have to use numerical methods.

SDR sharp uses a stochastic method, i.e., it makes random attempts to correct for phase and amplitude channel mismatch, takes an FFT, and then correlates the effects of the guesses on upper and lower sidebands, maximizing the aggregated power delta between opposite FFT bins. Over time, the more guesses make for better image rejection.

The method I used is similar, but it's iterative rather than stochastic, narrowing down phase and gain imbalance successively. While this attains the imbalance match more quickly it's a bit harder to implement.

If you're unable to get a balance, then whatever you're using to sample might not be simultaneously sampling. There have been instances of sound cards sampling 1 sample out on the left channel to the right channel which is impossible to correct for with I/Q imbalance correction alone.
 

Offline chris_leyson

  • Super Contributor
  • ***
  • Posts: 1541
  • Country: wales
Re: Simple diy SDR radio with Tayloe mixer and STM32
« Reply #152 on: June 20, 2016, 11:23:42 am »
50dB image rejection is quite respectable, I think 1% amplitude error or 1 degree phase error will give you 40dB image rejection, ball park figure. I quite like the Tayloe mixer architecture, it's a re-arrangement of the quad fet mixer but with all the sources tied to ground some you don't get gate source intermod effects.
 

Offline seriouscoinage

  • Contributor
  • Posts: 31
Re: Simple diy SDR radio with Tayloe mixer and STM32
« Reply #153 on: June 20, 2016, 11:41:27 am »
50dB is very reasonable for most analogue quadrature mixers, there's probably not much point trying to polish that any more, environmental effects such as temperature will start to become significant.

I am pretty familiar with the way the IQ image correction works in SDR Sharp, I did some work with the author of the software as well as doing my own IQ correction algorithms. I can assure you that it isn't "easily fixed in software", it is actually quite complex to get it right. It is not solvable analytically, you have to use numerical methods.

SDR sharp uses a stochastic method, i.e., it makes random attempts to correct for phase and amplitude channel mismatch, takes an FFT, and then correlates the effects of the guesses on upper and lower sidebands, maximizing the aggregated power delta between opposite FFT bins. Over time, the more guesses make for better image rejection.

The method I used is similar, but it's iterative rather than stochastic, narrowing down phase and gain imbalance successively. While this attains the imbalance match more quickly it's a bit harder to implement.

If you're unable to get a balance, then whatever you're using to sample might not be simultaneously sampling. There have been instances of sound cards sampling 1 sample out on the left channel to the right channel which is impossible to correct for with I/Q imbalance correction alone.
When I said "easily fixed in software," I was specifically talking about any gain imbalance, which I thought should be simple to fix by just multiplying one channel by a constant -  I didn't mean to imply that IQ correction is easy in general. I suppose if the SDR Sharp IQ correction doesn't do anything, then there must not be much gain imbalance anyway. I wouldn't be surprised if the imbalance was due to something the soundcard was doing - it's just whatever audio codec is an old computer's motherboard. In any case, 50dB is good enough for now. It's good to get some info from someone with more experience with SDR - I'm pretty new to all of this.

Hmm, seems working. What is the image rejection? And why does the switch has different bias, than the opamps? (not in the middle of the VCC)
I forgot to answer your question about the switch bias - with a 5V supply, the AD8421's common mode range is not centered on 2.5V, it is closer to 3V. The common mode range is also rather small. This doesn't seem to have caused any problems so far, but if I designed this again I would probably try a different approach than the in-amp ICs.

One approach I was thinking about was to simply avoid differential-to-single-ended conversion altogether. Have a preselector filter in the front end, followed by a LNA to provide any gain required and provide a 50ohm output for the mixer. Then the mixer outputs could be connected directly to a differential input audio ADC, possibly with an LC antialiasing filter in between. The only problem I can think of is that there might be problems with the LNA's nonlinearity, but I think the preselector should help with that. Are there any problems I'm missing with this approach?
« Last Edit: June 20, 2016, 11:47:55 am by seriouscoinage »
 

Offline Howardlong

  • Super Contributor
  • ***
  • Posts: 5319
  • Country: gb
Re: Simple diy SDR radio with Tayloe mixer and STM32
« Reply #154 on: June 20, 2016, 12:44:30 pm »
If you're going to have to do gain and phase corection in software anyway, then I don't see a lot of point in doing it in hardware unless you're trying to diagnose something else.

Typically the correction calculation itself is done by a couple of multiplies and an add to the streaming IQ signal: the difficulty is in calculating those fudge factors automatically!

If you are writing the software yourself, then you might want to try doing it manually with a couple of sliders on a UI to apply the coefficients, for example:

IOut = Iin
QOut = (QIn + (IIn  * k1) ) * k2

starting with k1=0 and k2=1. These two coefficients have interaction between them on the image rejection, so you need to repetitively adjust one then the other.

These will only correct for frequency indepedent errors. If there is a frequency dependent correction required then it's quite a bit more complicated, but typically for soundcard based SDR the above is easily good enough, with 90dB+ of image rejection achievable.
 

Offline YansiTopic starter

  • Super Contributor
  • ***
  • Posts: 3893
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: Simple diy SDR radio with Tayloe mixer and STM32
« Reply #155 on: June 20, 2016, 04:00:32 pm »
Thank you guys for some more valuable discussion. Those correction algorithms might be tried also, if I ever get the basics working. Unfortunately, again I've been doing different things and am currently outta any free time. :-(

seriouscoinage, if you happen to build the next version with gain concentrated in an RF LNA, could you please share the design with us?  Any schematic for inspiration would be very helpful for me. Thanks.

Yan
 

Offline eduardoG26

  • Newbie
  • Posts: 3
  • Country: de
Re: Simple diy SDR radio with Tayloe mixer and STM32
« Reply #156 on: June 01, 2017, 08:21:33 am »
My suggestion:
Take a cheap board called "ELEKTOR SDR reloaded"(german ELEKTOR 2016/7) designed by B. Kainka.
It contains a SI5351, Tayloe Mixer, Opamps, Filtering and plugs on any Arduino or STM32 nucleo.
Start of with arduino example sketch and roll your own SW on STM32 using IAR EWB f. e.
Good luck!
 

Offline cdev

  • Super Contributor
  • ***
  • !
  • Posts: 7350
  • Country: 00
Re: Simple diy SDR radio with Tayloe mixer and STM32
« Reply #157 on: June 05, 2017, 02:46:14 am »
If you ever return to this project, you can use a number of SDR programs - particularly Linrad, as a test bench of sorts to evaluate the I and Q output, even if the software cant talk directly to the hardware (to tune the LO, for example).
"What the large print giveth, the small print taketh away."
 

Offline YansiTopic starter

  • Super Contributor
  • ***
  • Posts: 3893
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: Simple diy SDR radio with Tayloe mixer and STM32
« Reply #158 on: June 12, 2017, 03:55:44 pm »
Thanks for a tip. I would like to definitely return to this project before the end of this summer, however I have got a difficult situation in here with family and jobs, so not much free time for toying. If I have to do electronics, it is mostly if not always for $$$. But I'll see how it'll go this summer.

Y.
 

Offline cdev

  • Super Contributor
  • ***
  • !
  • Posts: 7350
  • Country: 00
Re: Simple diy SDR radio with Tayloe mixer and STM32
« Reply #159 on: September 14, 2017, 08:14:25 pm »
You probably figured this out ages ago but a (resonant) magnetic loop, is a preselector and a very good one. If you havent already, ditch the active preamp and use a simple tuned circuit which can develop several volts at its output with a strong signal.

Back in the day they used to connect them to a diode and earphone and call it a receiver, look ma, no batteries.
Try that to give your SDR more sensitivity and especially, selectivity.

PM me if you want tips, this article has a bunch of great loop coupling ideas.


Whats the cheapest AM shortwave band receiver that could be built using an STM32 and a minimum of other parts?

"What the large print giveth, the small print taketh away."
 

Offline YansiTopic starter

  • Super Contributor
  • ***
  • Posts: 3893
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: Simple diy SDR radio with Tayloe mixer and STM32
« Reply #160 on: September 15, 2017, 11:56:46 am »
There were no problems getting RF signal, I could plug in an LO directly. There was problem to make the stupidly simple Tayloe mixer to work reasonably.  Maybe I will return to that and try again. Or maybe not, I will find a proper way to do it, instead of using cheepium MUXes that need 4f LO to work.
 

Offline cdev

  • Super Contributor
  • ***
  • !
  • Posts: 7350
  • Country: 00
Re: Simple diy SDR radio with Tayloe mixer and STM32
« Reply #161 on: September 15, 2017, 01:02:09 pm »
Is it possible to simulate the external hardware to chop up the signal in the STM32's own logic? When I say cheap I mean really cheap. See the thread I posted about a contest in the General Chat area. Basically I am wondering if its possible to make a tiny cheap shortwave receiver out of just an STM32 and a minimum of other parts (a few pushbuttons, maybe some varactor enabled circuitry to interface with a short piece of wire to provide an automatically tuned magnetic loop to improve selectivity and image rejection.

I have found that cheap SDRs work extremely well with a "hot" very high "Q" magnetic loop, Far better than with any other antenna. This can be shown graphically by using screenshots of the waterfall display using traditional antennas vs. high-q magloop. 

You can use an AB antenna switch and switch between the two, its quite useful to compare them that way.) Size is an issue, antenna has to be very small so it can be concealed -
People should consider that lots of poor people around the world have no access to a computer but would very much like to have a simple, tiny shortwave radio that could run on very low power and offer basic AM functionality up to around 20 MHz.

Especiallly people in North Korea where all tunable radios are illegal and large radios are much more likely to be found than small.

Radio often is what people sane. But to be caught with one can often be a life altering (or ending) experience. So the smaller the better.

Smaller, cheaper good radios would save lives.

See https://www.theguardian.com/global/2016/aug/27/north-korea-defectors-ian-birrell

also see
The Wall Which Crumbles: North Korea and the Outside World
http://raskb.com/transactions/VOL86/VOL86-3.docx

(this is a very good essay on the information blockade around North Korea)
also:

http://www.intermedia.org/wp-content/uploads/2013/05/A_Quiet_Opening_FINAL_InterMedia.pdf

See also:

http://www.psr.org/assets/pdfs/two-billion-at-risk.pdf

The cost of inaction could be very very high

« Last Edit: September 15, 2017, 01:15:24 pm by cdev »
"What the large print giveth, the small print taketh away."
 

Offline YansiTopic starter

  • Super Contributor
  • ***
  • Posts: 3893
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: Simple diy SDR radio with Tayloe mixer and STM32
« Reply #162 on: September 15, 2017, 05:26:35 pm »
I have no intents designing a HF radio for North Koreans. I do not wish these guys anything bad, but the sole purpose of this thread was I think different.

To answer your question: Some STM32s are equipped with multiple ADCs capable of reaching sample rates of up to about 10Msps when interleaved sampling is used, so direct reception of the LW, MW and lower SW signals might be possible. 

You do not need a separate I and Q basebands to be able to work with the signal digitally, you can direct sample the RF signal and then produce the I and Q by multiplying the signal with complex exponential  e^i*2*pi*f*t.  The unknown in this case is, if the MCU is fast enough to do this. I know about some shortucts to do this already an think it may be possible to do with reasonable performance. Maybe I should try that? All in all I wanted to tinker with the DSP algorithms any way...
 

Offline cdev

  • Super Contributor
  • ***
  • !
  • Posts: 7350
  • Country: 00
Re: Simple diy SDR radio with Tayloe mixer and STM32
« Reply #163 on: September 15, 2017, 05:54:25 pm »
I do too, the Tayloe mixer is a brilliant design. plus the utter cheapness of the STM32 - combined with its amazing ADC functionality just begs the question, can it be done.
"What the large print giveth, the small print taketh away."
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf