My experience with pd is comprised of the Dr. Hernandez tutorials and some controlling of leds and servo motors. I am a beginner in search of experiments to better my understanding of pd.
I read, a couple nights ago, a white paper on subwoofer servo controllers, used to lower distortion and better the frequency response. Essentially, an accelerometer is attached to the woofer's cone, which measures the output. The signal is fed back in, at line level and out of phase, to the input of the subwoofer. The measured distortion is effectively canceled out.
I thought to myself that it would be simple to write an equivalent patch in pd to the necessary electronics. On the other hand, I remembered the latency issues with pd. Am I right to assume that pd isn't fast enough for this particular application?
Would overclocking the computer make any difference (I'd even be open to watercooling, just for that sake of experimentation)? What about building a kernel? I read that even with these adjustments latency can only go so low as 1.5 ms, which I believe is too slow.
-
Subwoofer Servo Controller
-
@yaguirre !!Duh!! In Pd you could delay the signal to the speaker so that the correcting "out of phase signal" arrives at the same time as the "delayed" distorted signal.... like for a "feed forward" limiter.
But if the woofer makes a distorted signal then it is already too late to correct that, based on the data from an accelerometer, even if you have no delay (analogue). If the woofer has moved too far, and you try to bring it back within range..... well?.... it has already moved too far!
The only thing you can do is to assess the performance of the woofer using the accelerometer, model that, and then change the input to the woofer permanently so as to reduce distortion. Then you don't need the accelerometer any more. You can do that with a microphone though.
Probably just a decent compressor set up correctly would do the job.
Could you post a link to the white paper? I would put money on it being from Apple and the guys who developed "Logic"!
David. -
Yop,
one day I had a discussion with someone that teaches in a Master cursus (dunno exactly the branch, but it dealt with industrial processes), and he told me that he was using linux with a realtime kernel. Then I told him about my computer music deviance and rt patched system, proud of my few ms latency. He was amused and explained to me that realtime from "their" industrial point of view was much tighter than from "our" audio point of view. With the right hardware they achieve latencies of lower order, which I cannot remember, though.
Some (the pd latency put apart) microcomputer with addressable pins (gpio) could host linux and suit your needs, maybe. (Arduino, cubieboard, beagleboard, odoid,etc) Or a specific data acquisition device plugged into your "traditional" computer of course.
Nau
-
OK, maybe calling it a "white paper" is going a little too far since it was written by a college senior. Here it is anyway: http://www.danmarx.org/audioinnovation/servosub.html.
OK, let's say I set up a Raspberry Pi to work in real-time. I'd have to use a language other than pd right? -
@yaguirre As far as I know there is no way to have "realtime" in a computer. I suppose for a 50Hz signal you can get close enough. They have chosen 50Hz (narrow band filter) and applied a negative feedback loop to the signal from the output of an accelerometer which is only an approximation to the actual pressure wave produced. They are then surprised that having applied negative feedback at 50Hz the output level at 50Hz is reduced and that there is less distortion at that lower drive voltage. Their successful waveform has slower attack (negative feedback) and faster decay (idem) and no longer resembles a sine wave. Most of their distortion is probably from the box resonance at the higher spl.
Anyway, using asio or core audio you can get down to 2ms latency in Pd (if you are not doing too much work) which is the same as a professional mixing desk.
You can check your patch with an impulse and count the samples to work out how much extra latency you are adding to that 2ms (2 feet of air).
They do say in their paper that they had to use "analogue" though!Sub-woofer distortion can be avoided by using 2 drivers, one facing backwards and connected out of phase (so pushing the same way). All of the artefacts of the speakers are cancelled out at these frequencies. A dipole system and an amplifier with enough current reserve to control the diaphragms will do the job, but if you want an open box dipole design then you will need to carefully choose your speakers for adequate damping. You can get controlled bass down to 28Hz (-3db) with no harmonics. Check out "Gradient SW63". There are some detailed drawings for building your own on the web, although they are very simple......
David. -
Thank you everyone for your responses.
I am aware of dual loaded subwoofers. I'm simply looking for a project to expand my knowledge of pd. You're post, as everyone else's, was none the less very informative.
I'll do a little more investigating into this idea; although, I will try to brainstorm another project to tackle with pd.
If anything I've learned more about latency issues.