Demodulation  - Page 1
Forum section: electronics / beginners

author: baksuz
author_rank: Newbie
timestamp: March 19, 2019, 01:09:22 pm
content: Hello,I need to do demodulation of modulated signal where I have 2 wires sin+ and sin-(negative voltage) 3.3v peak voltage 10kHz, I need to do it with Arduino or STM32. Can someone give me any advice on how to do it or is it even possible?

author: janoc
author_rank: Super Contributor
timestamp: March 19, 2019, 02:34:34 pm
content: Quote from: baksuz on March 19, 2019, 01:09:22 pmThat's quite a confused mess. So all we know is that you have 2 power rails and a 10kHz signal. No idea what the 3.3V is about - are the two power rails +-3.3V? Or the input signal? (commas in sentences are kinda important, you know?).What kind of modulation are we talking about? What kind of signal? Which Arduino? 8bit one? Or 32bit ARM-based ones? Which STM32? They exist from tiny Cortex M0 that are unlikely to be able to do much up to a Cortex M7 that could demodulate radio signals in real time while still having most of the resources free ...Unless you tell us more, it is very unlikely that anyone will be able to help you.

author: rstofer
author_rank: Super Contributor
timestamp: March 19, 2019, 04:42:18 pm
content: Is the 10 kHz the modulating frequency or the carrier frequency? I would run the signal into a low pass filter to remove the carrier (envelope detector).Then I would run the demodulated signal into an ADC and sample at least twice the modulating frequency. Shannon/Nyquist will lead the way on sampling. Now you have a digital representation but memory is filling up fast!If you have to run the modulated carrier into the ADC, you are going to need a lot more bandwidth. You still need to sample at a rate at least twice the highest frequency and, depending on the carrier, this could be quite high.https://en.wikipedia.org/wiki/Envelope_detectorI don't know which uCs can sample at 20 kHz and still have time for other tasks. I would buy the chip with the fastest ADC on the planet and work down.

author: Benta
author_rank: Super Contributor
timestamp: March 19, 2019, 05:01:58 pm
content: Quote from: rstofer on March 19, 2019, 04:42:18 pmAssuming it's AM, ASK or OOK, which we don't know.

author: janoc
author_rank: Super Contributor
timestamp: March 19, 2019, 05:28:40 pm
content: Quote from: rstofer on March 19, 2019, 04:42:18 pmSome STM32s can do it, possibly even faster, especially if you use DMA. 20kHz is not that fast.Look up e.g. STM32-SDR project - here is one guy running a full HAM receiver on one of those Bluepill (STM32F103xxx) boards:And that's an old and relatively slow/low end STM32. The bigger ones can handle a lot more - this guy has an STM32F4xx running an oscilloscope at 2.8Msps:

author: iMo
author_rank: Super Contributor
timestamp: March 19, 2019, 06:14:14 pm
content: Best you have got I/Q input signal handy when trying to demodulate it. Some STM32 chips can do a simultaneous ADC conversion with 2 ADCs - for I and for Q. You can create I/Q in SW as well.They can do a few MSamples/sec at 12bit, thus 10kHz is easily doable.

author: baksuz
author_rank: Newbie
timestamp: March 20, 2019, 10:21:21 am
content: Sorry for sloppy explanation, I have carrier and message signal that are entering resolver as reference signal the are coming from function generator at 5v 10khz, out of resolver sensor I have 4 wires sine+- and cos+-, I need to modulate that signal to get envelope, I am using bluepill stm32, voltage is at normal level for adc for stm32. My question is how can I connect all of that, or is there need for anything else

author: kg4arn
author_rank: Unknown
timestamp: March 20, 2019, 11:04:57 am
content: I still don’t understand.

author: rstofer
author_rank: Super Contributor
timestamp: March 20, 2019, 01:01:15 pm
content: Google? Try 'demodulate resolver outputs', there are a LOT of hits including:http://www.jsst.jp/e/JSST2013/extended_abstract/pdf/Paper%20135.pdfOr you might find that Analog Devices has a chip to do the entire process:https://www.analog.com/en/analog-dialogue/articles/precision-rtdc-measures-angular-position-and-velocity.htmlMouser has the chip for about $20 and a development board for about $150

author: Benta
author_rank: Super Contributor
timestamp: March 20, 2019, 05:07:44 pm
content: For a resolver, you'd normally use the excitation carrier peak as a trigger for A/D converting the sin/cos inputs. This way you'll get a reading of the sin/cos peaks, and will avoid delays from the envelope detector (which there will be, it's just a low pass filter).

author: rstofer
author_rank: Super Contributor
timestamp: March 20, 2019, 05:13:18 pm
content: Quote from: Benta on March 20, 2019, 05:07:44 pmAbsolutely, an envelope detector wouldn't be satisfactory at all.

author: vk6zgo
author_rank: Super Contributor
timestamp: March 21, 2019, 12:47:30 am
content: Quote from: Benta on March 20, 2019, 05:07:44 pmWith a non linear device included------ without that, it won't demodulates anything!

author: Benta
author_rank: Super Contributor
timestamp: March 21, 2019, 10:43:10 am
content: Quote from: vk6zgo on March 21, 2019, 12:47:30 amI'm not sure you know the signal from a resolver. No need for anything non linear, it's pure sampling.

author: vk6zgo
author_rank: Super Contributor
timestamp: March 21, 2019, 02:12:31 pm
content: Quote from: Benta on March 21, 2019, 10:43:10 amSorry, I was really just commenting on the bit about the envelope detector.--- bit "tongue in cheek".

author: Benta
author_rank: Super Contributor
timestamp: March 21, 2019, 04:11:18 pm
content: Quote from: vk6zgo on March 21, 2019, 02:12:31 pmWell you're not wrong, just old fashionedIn a classic resolver you'd multiply the excitation carrier with the sin/cos signals to extract the polarity of sin/cos. Is a multiplier is non-linear? Dunno how to classify it.Today its all digitized with fast ADCs.

author: vk6zgo
author_rank: Super Contributor
timestamp: March 21, 2019, 11:20:05 pm
content: Quote from: Benta on March 21, 2019, 04:11:18 pmBoth classical & digital methods do generate unwanted mixing products which weren't originally there in the received signal, though.Aliasing in the sampling of a DSO is the most obvious case--- of course, that is in a wide band amplitude/ phase response device, so it will be a much greater problem.Both classical & modern methods find ways to cancel or filter out the unwanted products----- they just use different methods.To me, sampling near as dammit = mixing---- but, then, I'm old fashioned!