# Can it be a sine wave?

Alright, I’m doing a project requires manchester biphase in sine wave form. Is there a way I can modify the library below to make the wave produced be sine as compared to square?

http://mchr3k.github.io/arduino-libs-manchester/

I'm just guessing... Maybe in theory, but in practice, I doubt it...

In real-world data communication, the waveforms can look analog-like because it's hard to transmit a perfect square-wave or pulse over a distance, but digitally you are normally generating-transmitting and receiving-reconstructing digital pulses.

Certainly, you can easily "calculate" a sine wave in software...

Is this something for software-only, or are you trying to make something like a MODEM? If you want to make a MODEM, look-up how it's been done before.

• Manchester coding is a digital concept.

• The regular Arduino doesn't have a digital-to-analog converter built-in so it can't generate a sine wave signal (i.e. a voltage waveform) without additional software.

• You can't represent a true-continuous sine wave as digital data in software because a continuous wave requires an infinite number of points. Nyquist theory says you need a sample rate of at least twice the frequency or sample rate in order to sample the continuous analog waveform (analog-to-digital) and to reconstruct the continuous analog waveform (digital-to-analog).

• In the digital domain, I'm not sure how much 'frequency-resolution" you want, but you'd need at least 10 times the data rate (i.e. 10 sample points per sine cycle) to get anything that "looks like" a stair-stepped approximation of a sine wave. If you only care about the analog output and you don't need anything close to a sine wave in the digital domain, you can probably get closer to the Nyquist limit.

• You also need a number of bits to represent each sample's amplitude (i.e. 8-bit or 16-bits or more).

...The sample-rate and bit-depth requirements mean that you'd need at least 16-bits to represent one bit (one pulse-cycle). That is, if each transmitted/received bit is represented by many bits, your processor has to handle a LOT more data, which could mean slower data rates or it might require a more powerful processor.

DVDdoug:
I'm just guessing... Maybe in theory, but in practice, I doubt it...

In real-world data communication, the waveforms can look analog-like because it's hard to transmit a perfect square-wave or pulse over a distance, but digitally you are normally generating-transmitting and receiving-reconstructing digital pulses.

Certainly, you can easily "calculate" a sine wave in software...

Is this something for software-only, or are you trying to make something like a MODEM? If you want to make a MODEM, look-up how it's been done before.

• Manchester coding is a digital concept.

• The regular Arduino doesn't have a digital-to-analog converter built-in so it can't generate a sine wave signal (i.e. a voltage waveform) without additional software.

• You can't represent a true-continuous sine wave as digital data in software because a continuous wave requires an infinite number of points. Nyquist theory says you need a sample rate of at least twice the frequency or sample rate in order to sample the continuous analog waveform (analog-to-digital) and to reconstruct the continuous analog waveform (digital-to-analog).

• In the digital domain, I'm not sure how much 'frequency-resolution" you want, but you'd need at least 10 times the data rate (i.e. 10 sample points per sine cycle) to get anything that "looks like" a stair-stepped approximation of a sine wave. If you only care about the analog output and you don't need anything close to a sine wave in the digital domain, you can probably get closer to the Nyquist limit.

• You also need a number of bits to represent each sample's amplitude (i.e. 8-bit or 16-bits or more).

...The sample-rate and bit-depth requirements mean that you'd need at least 16-bits to represent one bit (one pulse-cycle). That is, if each transmitted/received bit is represented by many bits, your processor has to handle a LOT more data, which could mean slower data rates or it might require a more powerful processor.

I know the project is unusual, but its the the way I prefer to run te system. Basically, I'm using the biphase to control an animatronic and I'm going to be storing the biphase as audio. In order for me to square it back after it being recorded, it needs to be a sine wave to work well.

I'm a bit drunk so I didn't manage to read it all but with some capacitor (and resistor?) how could there be a problem to generate smooth voltage wave close to what you need? The capacitor (and resistor?) value may be application dependent but still you can try different capacitance and see if it work or not. As far as I know the problem usually is signal is not enough square-wave (with slow change in voltage level). If you need smooth wave it should be possible to convert the generated square wave to something-like-sine wave with external passive "hardware".

Many 1970's era computers had a cassette tape interface. What you're doing is not very different. Have a look around. Generally, for recording, a digital pulse train was low pass filtered (usually with an op amp filter) and reduced in amplitude before being sent to the tape deck.