kangsterizer / Audio_PPM_Linux

GNU Lesser General Public License v3.0
11 stars 5 forks source link

detail the method to obtain the amplitude please? #1

Closed MAVProxyUser closed 9 years ago

MAVProxyUser commented 9 years ago

Can you explain in depth how to figure this value out?

a2hill commented 9 years ago

I would also be interested in this. Do we just try to find the amplitude of the wav file?

MAVProxyUser commented 9 years ago

"find the amplitude of the wav file?" how does one do that?

kangsterizer commented 9 years ago

amplitude depends on the soundcard, driver settings, etc. if you want an exact value you need to measure the voltage out of the audio jack.

If you don't have a voltmeter you can also just adjust the value until it is detected, this generally works.

MAVProxyUser commented 9 years ago

Lets say I have a volt meter on hand, how would I measure the amplitude? Do I need a fancy one?

gdestuynder commented 9 years ago

safest would be to plug the audio jack in and measure the voltage on the exposed wires. if you have never done something like that you might want to just play with the amplitude value instead. its safer for you and your computer ;)

MAVProxyUser commented 9 years ago

lol pretty sure I can handle that. Just was not aware of how the voltage reading from my volt meter correlated to the variable in the python code. I don't expect my volt meter to plop out and say 20262 or 32760

I have a pretty generic Radio Shack MultiMeter - http://support.radioshack.com/support_meters/doc66/66016.pdf

gdestuynder commented 9 years ago

it doesn't work that way :) Your PPM module requires a certain peak voltage (depends on the PPM module/buddy port/trainer port). You measure how much amplitude "x" outputs in volts until you get the correct voltage. Then you use that number as amplitude.

Thats because the PPM module will only detect the signal above a certain threshold (a certain voltage) and there's no way that I know of to figure out what amplitude setting will be what voltage. In fact, if you add stuff in front like pulseaudio it could also modify the amplitude. Amplitude is just an analog voltage in the end tho.. thats why this stuff even works :)

For example, if my memory serves me right, the Spektrum DX7 needs at least 1v to detect the signal edge.

So tweak amplitude until you read 1v on the audio port, then record that amplitude. This is your amplitude number for your specific hardware+software setup.

Again, you can also just plug on the DX7 or another radio and play with the number until you notice the radio detects it.. works too ;)

kangsterizer commented 9 years ago

And on all these good words from my alter-ego, closing up :)