# OOK system question

Update

I think I now better understand what is going on. My question is, for an OOK system:

How can I determine the optimum carrier frequency for a given bandwidth and BER?

I asked the question below and since than I learned a lot about OOK systems, one of being which, even the OOK system has a bandwidth. (Originally, I didn't understood this since the carrier frequency doesn't change but amplitude does, so I assumed it is fixed frequency but AM modulation has also bandwidth since amplitude change is reflected in the frequency domain as bandwidth)

I have also updated the question below.

Original Question

I am building an OOK system. See the image below.

The block diagram of the system I have in mind is as follows:

Receiver -> Amplifier -> BPF -> Demodulator

I use 5MHz as my primary carrier frequency. (My target data rate is 1Mbps, but if this is not possible, I am ok to reduce to 500Kbps)

I have built the receiver and the amplifier, both on simulation and circuit wise they are working and they are in agreement. I am now working on BPF and Demodulator circuits.

Question:

What is the best demodulator circuit for this? I have considered a few alternatives:
- classical envelope detector followed by RC filter but too slow, also diode eats up very valuable signal there - Synchronous detection (PSD), works in simulation but this also suffers from the slow trailing RC filter [This is using the reference clock fed to +/-1 multiplier using Opamp]. Time constant of the RC filter is the primary problem, I can use a smaller time constant but I am assuming better solutions out there and PSD is not my first choice.

[This still needs to be investigated, but I am trying to get the theory work out for now]

• The bandwidth of the filter is related to the data rate. A 5 MHz carrier that is modulated by OOK has power at frequencies other than 5 MHz. In order to successfully receive that signal you have to capture all of those frequencies. – The Photon Jan 26 '12 at 5:50
• As I said, "A 5 MHz carrier that is modulated by OOK has power at frequencies other than 5 MHz". If you eliminate all frequencies other than 5 MHz all you will see is a continuously on 5 MHz carrier, which doesn't carry any information. – The Photon Jan 26 '12 at 6:23
• It will output zero if the carrier is absent, and 5 MHz if 5 MHz is input, but it will take a long time to switch between those two conditions if the carrier is switched on & off. How long depends on how narrow is the filter. – The Photon Jan 26 '12 at 6:46
• Only 5 carrier cycles to detect high or low level in the receiver is very ambitious. That will require a wide bandwidth filter, which will decrease the signal to noise ratio significantly. You will need a relatively powerful signal at the receiver to make this work all all. All around, not a good idea. – Olin Lathrop Jan 26 '12 at 13:02
• Another point to consider is that the signal formed by gating a 5MHz signal on and off at a uniform 500KHz rate will have significant spectral content at 5MHz+/-500KHz (unavoidable given your target data rate) but also at 5MHz+/-1.5Mhz, 5MHz+/-2.5Mhz, 5MHz+/-3.5MHz, etc. Modulating of arbitrary data may also add spectral content at other frequencies. If you hope to achieve any sort of regulatory approval, you need to switch your transmitter on and off more "gradually". – supercat Jan 26 '12 at 16:22

How can I determine the optimum carrier frequency for a given bandwidth and BER [for an OOK optical communication system ]?

There is no optimum carrier frequency. It would be nice if you could avoid frequencies already in use -- for optical communication, most of the time that's only the constant light from the sun, 100 Hz / 120 Hz light coming from ancient flickery fluorescent lights, and 30,000 Hz - 40,000 Hz light coming from modern fluorescent lights.

What is the best demodulator circuit for this?

I'm not sure you even want a demodulator. Perhaps you can more-or-less directly transmit Manchester-coded data, then recover with a high-pass filter (to remove sunlight) and a comparator.

There are many demodulator circuits that would work fine for this application. There are several low-cost demodulator ICs available at the big suppliers, some even in easy-to-prototype DIP packages, that work similar to the part described in ON Semiconductor Application Note AN531: "MC1496 Balanced Modulator". ( Actual Implementation of a Multiplier ) such as the SA612 (also called the NE612, SA602, etc.), the SA614, the MC1496, the TDA9881, MAX2685, BGA2022, TFF1017, SA58640, SA58641, MAX2682, UPC2757, etc.

You'll have to pick a carrier frequency somewhere in the range your demodulator can handle. The SA612 seems to work well up to roughly 50 MHz.

What filter should I use?

The rule of thumb is to try to capture most of the energy of each pulse. Filters should pass (preferably with a flat passband) the stuff you're trying to deliberately transmit, and should block as much as possible interfering stuff. There's a transition band between the passband and the stopband. For optical communication, sometimes this transition band is really wide, so you can get away with using simple and low-cost RC filters. (The lower parts of the frequency radio frequency communication spectrum have so many people trying to communicate at the same time that it forces the transition band to be narrow, which forces them to use more complicated filters).

With randomly positioned on/off pulses of width L seconds, the frequency distribution looks like (1/L)sinc(f/L), where sinc(x) = sin(pix) / (pi*x). (I.e. the Fourier transform of a rectangle function is a sinc function).

The first zero (end of the main lobe) of that sinc frequency distribution is at 1/L Hertz. Most of the energy of the sinc frequency distribution is in the main lobe -- between 0 Hz and 1/L Hertz.

If you choose to modulate that baseband signal by some carrier frequency -- perhaps something like the way the RC-5 protocol converts each pulse to a burst of square waves -- the main lobe has a bandwidth (between zeros) of 2/L Hz.

At 1 Mb/s, L = 0.5 microsecond for Manchester-encoded data (half the full bit-time). So the bandpass filter in your receiver needs to handle at least 4 MHz of bandwidth between the IR detector and the demodulator.

After the demodulator the lowpass filter should pass (up to the first zero) at least up to 2 MHz. To pass a minimum f of 2 MHz with a simple RC low-pass filter, w = tauf =~= 12.6 Mradians/s; and the RC time constant T = 1/w = RC =~= 80 ns. So, for example, if I arbitrarily choose C = 1 nF, the maximum R is 80 Ohms.

The lowpass parts of your bandpass filter, being at a much higher frequency, requires an even smaller time constant, which implies a smaller R or C or both.

The Shannon–Hartley theorem and the Fourier transform revolutionized telecommunications.

Most EE programs run students through several semesters of classes to clear out common misunderstandings and to fully understand the ramifications of these simple-seeming ideas.

You might consider skimming through the relevant sections of a digital signal processing book.

Have I mentioned the RC-5 protocol? You could do worse than to try to speed up each part of that (approximately) 562 bit/second protocol by (approximately) 1000 or 2000 times faster to get (approximately) 500,000 bit/second or 1 Mbit/second. Each bit of data is Manchester coded into two half-bits, with 32 pulses in one half-bit and the LED turned off for the other half-bit. (That seems to require a 64 MHz clock to get a full 1 Mbit/second, and lots of hardware can't go that fast -- perhaps fewer pulses per half-bit, more like Ronja, or fewer data bits per second, would make it easier to use standard off-the-shelf hardware).

You might also consider looking at the the RONJA project, especially the schematics. They use some unusual clever tricks to get their data rate up to 10 Mbit/s using low-cost parts. The incoming 10BASE-T Ethernet has already Manchester coded each data bit into two half-bits, and Ronja transmits one or 2 pulses per data bit. (In effect, Ronja turns the LED on for 1 clock pulse per data bit, and the receiver watches to see if Ronja transmits another pulse or not to decide whether the data bit is a 1 or a zero).

Sounds like a fun and educational project. Good luck!

• Note: OP is not asking about optical communications. He is asking about an OOK rf system. – The Photon Mar 2 '12 at 16:39
• @ThePhoton: At first it seems like Ktc is talking about RF, but later Ktc seems to say "My system is optical." – davidcary Mar 4 '12 at 3:39
• Ah, you're right...but it took plenty of searching to find that comment. – The Photon Mar 5 '12 at 5:31

The bandwidth of the OOK system is twice the bandwidth of the baseband signal because AM modulation translates the baseband spectrum $H(f), -\infty < f < \infty,$ to be centered at the carrier frequency, i.e., $H(f-f_c) + H(f+f_c)$. If $|H(f)| = 0$ for $|f| > f_s$, then the AM signal spectrum is nonzero in the range $f_c-f_s < f < f_c + f_s$ (and of course also nonzero in the negative frequency range $-f_c-f_s < f < -f_c + f_s$). So, $f_c > f_s$ is a minimal requirement for the carrier frequency. As a practical matter, if $f_s = 500$ kHz, a $1$ MHz band at, say, $70$ MHz carrier frequency might be a better choice than a $1$ MHz band at $5$ MHz carrier frequency.

If you can manage shaping of the baseband pulse (i.e., you are not constrained to use the rectangular pulses shown in your figure), you might want to look into using a smoother pulse in order to reduce the bandwidth. Rectangular pulses with their $\text{sinc}(fT)$ spectra have quite large bandwidth, and while used quite commonly in communication theory texts for illustrative purposes, are not often used in practical systems. Finally, I suggest that you think a bit about the BPF in your diagram. You want it to be wide enough to capture most of the signal and narrow enough to reject most of the out-of-band noise, and the $Q$ of the filter (which is a crude measure of how long the filter output will continue to ring) will limit the data rate (or create intersymbol interference (ISI) issues that will need to be addressed.)