|
| Notices |
Welcome to the DriverHeaven.net forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
 |
Jan 29, 2006, 02:00 PM
|
#1
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 3,715
|
Voice scrambler for VOIP
Ok - I know Ive been kinda quiet - Im still stuggleing with understanding DSP programming.
I had this great idea (as seen in the thread title) and started making a plug in that can be used.
The concept is this...
Mixing an input (MIC) with an oscillator - the passed through a LP or BP filter is 'supposed' to cause 'FREQUENCY INVERSION' - a common/ easy speech scrambling system.
As long as the transmitters oscilator frequency matches the receivers frequency - its supposed to 'de-scramble' - But Im finding its not working as expected in real life.
What Im not understanding is the 'MIXING' - as in a RF (side bands on a HAM or CB radio)
In electronics the 'schematic symbol' looks like IN 1 + In2 - the ACC3 instruction.
But that just just adds (mixes) a tone to your voice.
So I tried out = exp(Log (in1) + Log (in2)) - simple multiply after scaling both inputs down to prevent saturation
.
- I then, in the DSP - just connected pre-made LP and BP filters (1 try was with LP and another try with BP)
And IT does scramble - but not descramble.
Any hints on how I'm wrong in my logic here?
Has any one done this successfully?
Keep in mind - I have ONLY tested by recording and playback locally - which removes any VOIP compression problems that are a definite potential headache - but even just to scramble voice recordings would be a nice 'accomplishment' for me.
Last edited by Maddogg6; Jan 30, 2006 at 04:48 PM.
|
|
|
Jan 29, 2006, 04:09 PM
|
#2
|
|
DH's Latest Mac Convert
Join Date: Jun 2003
Location: Basement of the first floor
Posts: 15,625
|
you're looking to create a sort of vocoder system? now that could get interesting
|
|
|
Jan 29, 2006, 04:39 PM
|
#3
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 3,715
|
I thought so too -
I have a hard time - (read, 'little motivation') learning how to re-invent wheels.
I much rather learn how to do something different.
I know - its THE hardest way to learn - but I tend to avoid the 'simple'.
I mean if I wanted 'simple' - Id stick with CL drivers - right?
Also,
I noticed a 'RINGMOD' plugin - thats sorta what *I THINK* the mixer is that Im refering to, but only has 1 input - no 'modulation' input and THERES A WHOLE LOT of stuff in ITS source I dont understand as of yet.
|
|
|
Jan 29, 2006, 06:11 PM
|
#4
|
|
S-3D enthusiast
Join Date: Sep 2004
Location: Canada
Posts: 1,409
|
I think RF mixing equals multiplication of the digital samples.
It should not overflow because the higher it can go is 1*1 = 1.
I haven't tested it but I think that you have to choose an oscillator frequency that is not too high or else you will have components over 24kHz and it will not work (aliasing problems?). You also have to filter the signal beforehand to remove parts of the signal that would go over 24kHz. I could be wrong but that seems to makes sense.
Before the decoding, you have to filter out the content over the oscillator frequency. After the decoding, you also have to filter out the content over the oscillator frequency.
I'm not experienced with RF electronics so don't shoot me if I made some mistakes.  I may give it a try myself later. It seems fun.
EDIT : I just tested it. It works well.
Code:
; New microcode
name "SD";Scrambler/Descrambler
copyright "Copyright (c) 2006. Tril";
created "01/29/2006";
engine "kX";
; comment "";
guid "d1f87c79-c2f3-4a28-87d3-e007e9b127e5";
; -- generated GUID
; itramsize 0
; xtramsize 0
input inL, inR, Frequency;
output outL, OutR;
; code
macs outL, 0, inL, Frequency;
macs outR, 0, inR, Frequency;
end
Last edited by Tril; Jan 29, 2006 at 06:44 PM.
|
|
|
Jan 29, 2006, 07:08 PM
|
#5
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 3,715
|
Yeah, the frequency - in kits Ive seen are 3-10 Khz - so the aliasing thing will not be much factor until the compression from VOIP id think.
But I dont see what kind or Fc/Fr the filters use in the circuit. So, I guess I didnt try the filtering enough.
Doh - I went in a way more complicated manner with the LOG and EXP stuff. [*slaps self in face for such HUGE oversight*]
AND I didnt filter the input - I bet MIC noise had something to do with my failing.
Whoo hoo - now I can do James Bond Stuff in messenger (or at least feel like I am  )
Thanks Tril. - U da Man!
And this would also be considered a vocoder also Im thinking??
|
|
|
Jan 29, 2006, 08:08 PM
|
#6
|
|
S-3D enthusiast
Join Date: Sep 2004
Location: Canada
Posts: 1,409
|
For the code I posted, you connect a sine wave from Wave Generator. The filtering before and after the descrambling does not seem to be essential. It seems to works without it.
|
|
|
Jan 29, 2006, 09:46 PM
|
#7
|
|
DriverHeaven Extreme Member
Join Date: Jan 2005
Posts: 4,101
|
I think for better results (when using a sine wave like with Tril's example) you would need to add some way to sync the cycles of the sine waves for the decoder and the encoder. i.e. For testing, you probably used the same sine wave for both, but for a use like VOIP, the person receiveing the signal would have to use there own sine wave to decode it, and if they are out of phase with each other then it will not work right.
In any case it is fun to play with 
|
|
|
Jan 29, 2006, 10:58 PM
|
#8
|
|
S-3D enthusiast
Join Date: Sep 2004
Location: Canada
Posts: 1,409
|
Quote:
|
I think for better results (when using a sine wave like with Tril's example) you would need to add some way to sync the cycles of the sine waves for the decoder and the encoder
|
I don't think it's necesary. It's the frequency of the sine wave that is important, not the phase.
I recorded the scrambled signal. I played it back and mixed it with a sine wave from the DSP and it sounded good. The phase was random as it depended on when I pressed the play button.
A personnal radio works even if the oscillator in the radio is not in phase with the broadcasting station oscillator in their gear so I would tend to think that phase does not matter.
|
|
|
Jan 29, 2006, 11:12 PM
|
#9
|
|
DriverHeaven Extreme Member
Join Date: Jan 2005
Posts: 4,101
|
Maybe, I do not know a lot about that either, but I tried it using 2 different wave generator plugins, which I set to different frequencies to ensure that they were out of sync with each either, and then reset them one at a time so that they were both at the same frequency, but out of phase with each other and it stayed scrambled. Maybe it is just an issue with the wave generator plugins?
|
|
|
Jan 29, 2006, 11:28 PM
|
#10
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 3,715
|
Confirmed - the phase is not supposed to be relevant just the frequencies.
But it seems like filter adjustments/carrier frequency are more critical than I first assumed from the projects instructions. Also, fidelity is not of consideration - so phase errors are probably considerd 'acceptable'
I thinking your making same mistakes with filtering as I am/was. It does seem to be touchy.
Im looking for a relationship of carrier freq and filter frequency - but not mentioned in text. Diagram just shows a filter - and recomends 'tweaking' the filter until audio is intelligable.
ITS STILL FUN - woo hoo. 
|
|
|
Jan 30, 2006, 01:42 AM
|
#11
|
|
DriverHeaven Extreme Member
Join Date: Jan 2005
Posts: 4,101
|
The other thing about VOIP is that it uses compression, so that could mess it up too, but I did try a loopback test with Teamspeak for the heck of it, and using one of the higher quality codecs, it wasn't terriible.
|
|
|
Jan 30, 2006, 04:02 AM
|
#12
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 3,715
|
This is good news.
Did you notice Q differences with different carriers?
|
|
|
Jan 30, 2006, 02:23 PM
|
#13
|
|
DriverHeaven Extreme Member
Join Date: Jan 2005
Posts: 4,101
|
Quote:
|
Originally Posted by Maddogg6
This is good news.
Did you notice Q differences with different carriers?
|
I actually did not do that much testing. I was mostly interested in seeing if it would be intelligable after being compressed, and it was (not great, but not terrible (it was distorted but understandable). And again, that was just a loopback test, so that data was not actually sent over the internet (additionally I was using a higher quality codec than what would normally be used while gaming, and I used the same sine wave for both encoding and decoding).
|
|
|
Jan 30, 2006, 02:35 PM
|
#14
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 3,715
|
Quote:
|
Originally Posted by Russ
I actually did not do that much testing. I was mostly interested in seeing if it would be intelligable after being compressed, and it was (not great, but not terrible (it was distorted but understandable). And again, that was just a loopback test, so that data was not actually sent over the internet (additionally I was using a higher quality codec than what would normally be used while gaming, and I used the same sine wave for both encoding and decoding).
|
oops I wasnt very clear in my last post - I was wondering if you had tried different carrier frequncies - and if so, if you noticed quality differences.
I also had additional ideas to play with:
1) use 2 wave gens and mix (simple sum) 2 different frquencies - to make a more complex waveform - and use that as the 'FREQUENCY' input (I've been calling 'carrier')
2) Prove that a 'NOISE' wave form for a carrier makes it impossible to de-scramble. As the nature of noise is random - BUT if psudo random noise was used (something with a pattern - should be still possible, but more difficult to 'crack'). Maybe filtered noise??
3) Record the random noise in left channel - and scrambled message in right channel - should allow de-scrambling - if the left channel is used for carrier.
For SUPER secret - this wave file could be embedded in a BMP file (I forget the name of this subject - 'stegonography' - I think)
I wish I was smart enough to accomplish all my ideas I get.. hehe.
Just food for fun - or headaches... ?? I dunno... till I need the asprins. 
|
|
|
Jan 30, 2006, 02:50 PM
|
#15
|
|
DriverHeaven Extreme Member
Join Date: Jan 2005
Posts: 4,101
|
I understood what you meant, I only meant to say that I do not do that much testing (i.e. different carrier frequencies).
For a 'stegonography' type of thing, any linear function should work, and could actually give better results.
i.e.
multiply every other sample by -1, producing high frequency noise... when decoded would reproduce the original waveform exactly.
/////////////////////////////////////////
input inl, inr;
output outl, outr;
static flipflop=0x1
macints outl, 0x0, inl, flipflop;
macints outr, 0x0, inr, flipflop;
macints flipflop, 0x0, 0xffffffff, flipflop;
/////////////////////////////////////////
BTW: That is just a simple example, it does really scramble the signal.
i.e. (showing the original signal (green) and the modified signal (yellow)).
http://i1.tinypic.com/mv5leb.gif
Last edited by Russ; Jan 30, 2006 at 03:38 PM.
|
|
|
Jan 30, 2006, 03:54 PM
|
#16
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 3,715
|
Well, I was thinking more like described here -
http://en.wikipedia.org/wiki/Steganography
The difference being that the encryoted message is hidden with in an 'normal' message. - where in cryptology - its obvious a encrypted message is present, as thats all that is present.
Thus: the code you proposed would replace the other scrambling (or in addition to) - but doesnt 'hide' this message into anything 'unassuming' -
I guess Im thinking the 'high pitched' noise the above code would make - *could* be the equivelent of seeing a PGP encrypted message -compared to; if its output sounded like a song or something intelligable.
|
|
|
Jan 30, 2006, 04:16 PM
|
#17
|
|
DriverHeaven Extreme Member
Join Date: Jan 2005
Posts: 4,101
|
Yeah, I understand what steganography is, I was just showing a simple example.
Still using that simple example, if you used a stereo mix plugin, with one stereo signal passed through the 'scrambler', and then mixed with some other stereo signal, when you recorded it, and then played it back, you would mainly hear the 'non-scrambled' signal. But, if you played it back through the same 'scrambler' then the second audio signal would end up beging 'scrambled', but the first signal would now be 'unscrambled', thus now you would hear mainly the first audio signal. Again, the signal itself might look suspusious as you mentioned, but it is just a basic example, but fun to play with  .
|
|
|
Jan 30, 2006, 04:55 PM
|
#18
|
|
Tail Razer
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 3,715
|
Quote:
|
Originally Posted by Russ
Yeah, I understand what steganography is, I was just showing a simple example.
Still using that simple example, if you used a stereo mix plugin, with one stereo signal passed through the 'scrambler', and then mixed with some other stereo signal, when you recorded it, and then played it back, you would mainly hear the 'non-scrambled' signal. But, if you played it back through the same 'scrambler' then the second audio signal would end up beging 'scrambled', but the first signal would now be 'unscrambled', thus now you would hear mainly the first audio signal. Again, the signal itself might look suspusious as you mentioned, but it is just a basic example, but fun to play with  .
|
Ahh - that IS BRILLIANT Russ. -
I was more thinking embedding into a pic - not another wave file...
BUT!
Now that this is public - Im gonna HAVE to listen to all my MP3s through the descrambler - which will prolly scramble my brain even MORE!
DAMN YOU RUSSS AAAHHHHH!!!!!-
ROTFLMAO.
|
|
|
|
|
|