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?
I'm just guessing... Maybe in theory, but in practice, I doubt it...
In realworld data communication, the waveforms can look analoglike because it's hard to transmit a perfect squarewave or pulse over a distance, but digitally you are normally generatingtransmitting and receivingreconstructing digital pulses.
Certainly, you can easily "calculate" a sine wave in software...
Is this something for softwareonly, or are you trying to make something like a MODEM? If you want to make a MODEM, lookup how it's been done before.

Manchester coding is a digital concept.

The regular Arduino doesn't have a digitaltoanalog converter builtin so it can't generate a sine wave signal (i.e. a voltage waveform) without additional software.

You can't represent a truecontinuous 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 (analogtodigital) and to reconstruct the continuous analog waveform (digitaltoanalog).

In the digital domain, I'm not sure how much 'frequencyresolution" 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 stairstepped 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. 8bit or 16bits or more).
...The samplerate and bitdepth requirements mean that you'd need at least 16bits to represent one bit (one pulsecycle). 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 realworld data communication, the waveforms can look analoglike because it's hard to transmit a perfect squarewave or pulse over a distance, but digitally you are normally generatingtransmitting and receivingreconstructing digital pulses.
Certainly, you can easily "calculate" a sine wave in software...
Is this something for softwareonly, or are you trying to make something like a MODEM? If you want to make a MODEM, lookup how it's been done before.
Manchester coding is a digital concept.
The regular Arduino doesn't have a digitaltoanalog converter builtin so it can't generate a sine wave signal (i.e. a voltage waveform) without additional software.
You can't represent a truecontinuous 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 (analogtodigital) and to reconstruct the continuous analog waveform (digitaltoanalog).
In the digital domain, I'm not sure how much 'frequencyresolution" 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 stairstepped 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. 8bit or 16bits or more).
...The samplerate and bitdepth requirements mean that you'd need at least 16bits to represent one bit (one pulsecycle). 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 squarewave (with slow change in voltage level). If you need smooth wave it should be possible to convert the generated square wave to somethinglikesine 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.