0

I am making an iphone app that will transmit data via sound. It takes a binary string and plays a tone for each 1 and silence for each 0.

(String example)

NSString* asciiString = @"www.google.com";
NSString* binaryString = AsciiToBinaryString(asciiString);
// binaryString == @"01110111 01110111 01110111 00101110 01100111 01101111 01101111 01100111 01101100 01100101 00101110 01100011 01101111 01101101"

Howver, this simple tone method is prone to errors and I think I need to use binary phase shift keying.

I would like to know how to apply binary phase shift keying to my binary string.

I'm not sure how to implement this. Any suggestions or code samples would be appreciated.

PS:

I did do a search on stack overflow and google and was not satisfied with what I found. I looked at the GNU Radio project but don't understand python.

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94
Guff Guff
  • 13
  • 3
  • Why do you think you need binary phase shift keying? What sort of tone are you trying to make? – dreamlax Jan 17 '13 at 08:32
  • It is for the purpose of transmitting data. In this case, a string. A receiving phone will pick up the sound with the mic and turn it back into data. The frequency is around 18~19kHz. If you have an alternative suggestion to PSK let me know. I am new to this and am not sure how to implement it. App is inspired by shopkick, SonicShare etc... – Guff Guff Jan 17 '13 at 08:34

1 Answers1

0

PSK is not gonna be easy if possible at all on iPhone. Frequency Shift Keying (FSK) should be possible. But I think what you need first is a higher level protocol that breaks up the data stream in bytes for example, and includes some checks. Think of the good old RS-232 serial protocol with start/stop bits and parity.

On the other hand, there are various apps that use the iPhone's audio port for data transfer. I did not look, but I can imagine that people must have written about this. And I would not be surprised if there're open source or commercial projects that give you this functionality out-of-the-box.

Good luck & enjoy, it sounds like a fun project!

meaning-matters
  • 21,929
  • 10
  • 82
  • 142