Author Topic: Demodulation of a data  (Read 2135 times)

0 Members and 1 Guest are viewing this topic.

Offline fateme mrbsTopic starter

  • Newbie
  • Posts: 9
Demodulation of a data
« on: August 20, 2018, 03:10:02 pm »

I have created the first signal in my circuit and the second signal that you see in this picture is what I'm trying to get at the output.
Can anybody tell me what circuit can demodulate the first signal and get the second one?
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 5869
  • Country: de
Re: Demodulation of a data
« Reply #1 on: August 20, 2018, 03:19:57 pm »
Simple averaging of the signal (=LPF) followed by a clipping amplifier should get you close. Of course, a synchronous demodulation would be better.
 

Offline fateme mrbsTopic starter

  • Newbie
  • Posts: 9
Re: Demodulation of a data
« Reply #2 on: August 20, 2018, 03:35:55 pm »
Thanks for your answer.
I already tried low pas filtering. It doesn't give a neat pulse.
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 5869
  • Country: de
Re: Demodulation of a data
« Reply #3 on: August 20, 2018, 04:08:45 pm »
Thanks for your answer.
I already tried low pas filtering. It doesn't give a neat pulse.

That's why you need to amplify afterwards. Otherwise you won't get a square wave.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3237
  • Country: gb
Re: Demodulation of a data
« Reply #4 on: August 20, 2018, 04:51:14 pm »
Your post is showing the signal being demodulated before even the first pulse has been received, and returning back to '0' immediately after the last pulse has been received.  It should be obvious that this will not be possible in practice, unless you have already built a time machine.  There will always be some latency between input and output.

If the amplitude and timing of the pulses is well defined as shown i.e. the logic 1 pluses are always significantly higher amplitude than the logic 0 pluses then you may be able to feed the signal into a (very fast) comparator with a suitable threshold set (somewhere between logic o and logic 1 values), and use the output to trigger a (re-triggerable) monostable with a period just slightly longer then the period between your pulses.  The downside of this would be noise immunity, and getting the 0/1 duty cycle correct
 

Offline mmagin

  • Frequent Contributor
  • **
  • Posts: 610
  • Country: us
Re: Demodulation of a data
« Reply #5 on: August 20, 2018, 07:18:05 pm »
This is FSK?  You could build a demodulator with a PLL (e.g. CD4046).  Although it looks like the two frequencies have a 2:1 relationship ... it would be a lot easier if they didn't have a harmonic relationship -- that will confuse some phase detectors.
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: Demodulation of a data
« Reply #6 on: August 20, 2018, 07:25:53 pm »
Thanks for your answer.
I already tried low pas filtering. It doesn't give a neat pulse.

That's because demodulator is more than just simple filter. Hint: you can/shall sample filter output at exactly middle of the symbol, if/when you know where middle of the symbol is. Next question would be - how to sync symbols. I would answer: it's easy when bitstream is encoded for easy bit sync. Google for Manchester coding and NRZ coding.
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 5869
  • Country: de
Re: Demodulation of a data
« Reply #7 on: August 20, 2018, 08:07:51 pm »
This is FSK?  You could build a demodulator with a PLL (e.g. CD4046).  Although it looks like the two frequencies have a 2:1 relationship ... it would be a lot easier if they didn't have a harmonic relationship -- that will confuse some phase detectors.

With just three cycles to change lock, that's totally unrealistic.
 

Offline mmagin

  • Frequent Contributor
  • **
  • Posts: 610
  • Country: us
Re: Demodulation of a data
« Reply #8 on: August 21, 2018, 01:10:10 am »
This is FSK?  You could build a demodulator with a PLL (e.g. CD4046).  Although it looks like the two frequencies have a 2:1 relationship ... it would be a lot easier if they didn't have a harmonic relationship -- that will confuse some phase detectors.

With just three cycles to change lock, that's totally unrealistic.

Yeah, I suppose you're right.
 

Offline fateme mrbsTopic starter

  • Newbie
  • Posts: 9
Re: Demodulation of a data
« Reply #9 on: August 21, 2018, 08:23:08 am »
Thanks for your answer.
I already tried low pas filtering. It doesn't give a neat pulse.

That's why you need to amplify afterwards. Otherwise you won't get a square wave.

the problem is that the low level after low pass filtering is above zero and an amplifier will amplify both high and low levels. so again I won't get an square wave.
 

Online vk6zgo

  • Super Contributor
  • ***
  • Posts: 7584
  • Country: au
Re: Demodulation of a data
« Reply #10 on: August 21, 2018, 11:12:37 am »
Thanks for your answer.
I already tried low pas filtering. It doesn't give a neat pulse.

That's why you need to amplify afterwards. Otherwise you won't get a square wave.

the problem is that the low level after low pass filtering is above zero and an amplifier will amplify both high and low levels. so again I won't get an square wave.

Retro style was to amplify the hell out of it, then clip it savagely both top & bottom.
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 5869
  • Country: de
Re: Demodulation of a data
« Reply #11 on: August 21, 2018, 11:49:31 am »
Thanks for your answer.
I already tried low pas filtering. It doesn't give a neat pulse.

That's why you need to amplify afterwards. Otherwise you won't get a square wave.

the problem is that the low level after low pass filtering is above zero and an amplifier will amplify both high and low levels. so again I won't get an square wave.

That's not a problem, it's a feature   ;)

Imagine low pass filtering the signal so you get something sinewave-like. That's your demodulated signal.
Low pass filter your demodulated signal until the sine wave is gone. That's your DC reference (in the middle of the sine wave).
Feed both to a differential amplifier to make a square wave.

 

Offline rhb

  • Super Contributor
  • ***
  • Posts: 3481
  • Country: us
Re: Demodulation of a data
« Reply #12 on: August 23, 2018, 02:26:06 am »
Two  approaches come to mind:

count pulses if that's applicable

measure the time since the last pulse

In either case, use a delay line to synchronize the input and output.  Fundamentally that's what oscilloscope trigger circuits do.  The signal is delayed a bit so that the trigger logic has time to determine if it should start a sweep.

If you absolutely can't tolerate the latency of the delay line, use two analog correlators and feed the outputs to a comparator.

If the two signals are constant, sample and feed to a pair of shift registers wired to to do an AND of the two patterns. 

Or clock the samples through a shift register, use the contents as an address into a lookup table that gives the desired output.  The latter approach has the advantage that you can populate the LUT to accommodate variable timing and amplitude.  At the price of a larger LUT.
 

Offline fateme mrbsTopic starter

  • Newbie
  • Posts: 9
Re: Demodulation of a data
« Reply #13 on: August 25, 2018, 10:13:55 am »
.  There will always be some latency between input and output.

the latency is not important. but the width of the pulse is. it should only cover the higher level pulses
« Last Edit: August 25, 2018, 10:17:15 am by fateme mrbs »
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3237
  • Country: gb
Re: Demodulation of a data
« Reply #14 on: August 25, 2018, 12:11:27 pm »
.  There will always be some latency between input and output.

the latency is not important. but the width of the pulse is. it should only cover the higher level pulses

Maybe we need to step back a bit here, as I'm not familiar with the way you are generating these pulses.   Does each separate pulse represent one bit, or is one bit represented by many pulses (e.g. 8 pulses for a logic 1)?  If the latter, if there always the exact same number of pulses and pulse timing for each bit?

If there are multiple pulses per bit this will not be easy to demodulate to meet your requirement above, certainly a low pass filter and slicer isn't going to cut it.

 

Offline fateme mrbsTopic starter

  • Newbie
  • Posts: 9
Re: Demodulation of a data
« Reply #15 on: August 25, 2018, 03:30:51 pm »
.  There will always be some latency between input and output.

the latency is not important. but the width of the pulse is. it should only cover the higher level pulses

 Does each separate pulse represent one bit, or is one bit represented by many pulses (e.g. 8 pulses for a logic 1)?

the latter. one bit is represented by 8 pulses.
[/quote]
 If the latter, if there always the exact same number of pulses and pulse timing for each bit?
[/quote]
almost, when i monitored it over a longer time. sometimes one pulse was missed. (7 pulses for a logic 1)
 

Offline fateme mrbsTopic starter

  • Newbie
  • Posts: 9
Re: Demodulation of a data
« Reply #16 on: August 26, 2018, 11:58:27 am »


If the amplitude and timing of the pulses is well defined as shown i.e. the logic 1 pluses are always significantly higher amplitude than the logic 0 pluses then you may be able to feed the signal into a (very fast) comparator with a suitable threshold set (somewhere between logic o and logic 1 values), and use the output to trigger a (re-triggerable) monostable with a period just slightly longer then the period between your pulses.  The downside of this would be noise immunity, and getting the 0/1 duty cycle correct

I have these pulses after the comparator. (first picture)
I tried using a monostable without having those more widely spaced pulses, (they were supposed to represent a logic 'zero'). and the result is good.
But when I use the same monostable WITH the more widely spaced pulses, the result is crazy!

Why is that so? :(
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf