![]() |
![]() ![]() ![]() ![]() ![]()
|
next newest topic | next oldest topic |
Author | Topic: Analog Computing with Kyma!! | |
David McClain Member |
![]() ![]() ![]()
Back when I was just a kid in college, they used to have actual analog computers -- in hardware -- op amps and 10 turn trimpots and patch chords galore! I used to lust after one of these babies... But over time, they fell out of fashion in favor of digital computing. Only trouble is, using a digital computer to solve some of these hairy equations is a real gory job. But Kyma to the rescue! It is a digital computer, but the way Carla and Kurt have developed its interface, it appears very similar to an analog computer. They even provide nice computing elements like gain blocks with faders attached, integrators, and summing junctions (mixers). Unlike the old fashioned analog computers, Kyma excels at high-rep-rate computing. Whereas the old fashioned computers used slowly varying DC voltage levels, Kyma prefers to compute things really quickly at high AC frequencies. The gain developed by an integrator in Kyma is (SignalProcessor sampleRate / (2 * Float pi * Frequency)) so to bring that gain back down you need to apply a little input scaling times the inverse of this gain factor. I include a RESET switch to dump any accumulated DC offsets, and this switch merely cuts the integrator feedback to zero and sets the input gain temporarily to zero. Once you release that button, the system takes off again. Proper scaling techniques need to be applied to keep all the amplitudes (voltages?!) in scale. We have a limited op-amp range of +/- 1 unit (volt?!). The examples included here show first how the integrator gain can be held constant as you vary the frequency. The second one implements a version of my Ear Equation using a peak detector with 1 ms attack and 30 ms release in the feedback path to the first integrator. Adjustable parameters on the VCS are Amplitude (dB) and Frequency (Hz) of the input signal, the stiffness constant K, the nonlinear feedback constant Gamma, and the damping factor Rho. There is an adjustable scale factor (!SF) used to keep all the op-amps from saturating or clipping. As you play around with Gamma, keeping K and Rho near their nominal values of 1.1 and 0.8 respectively, you will find that high amplitude inputs start to develop harmonics with Gamma greater than zero. These die away quickly with decreasing signal amplitude. You also find that the system acts like a gain compressor when Gamma is greater than zero. As the frequency of the input is raised, the harmonic generation diminishes, but the gain compression remains. Using a DSP box for stand-in analog computing has its drawbacks... notably, at high frequencies, the phase shift induced by the 1 sample feedback elements becomes troublesome. But in this case we have a sample rate of 44100 Hz against a problem that analyzes frequencies below 250 Hz. That's plenty of wiggle room! I know, I know... I really ought to get back to making noise. But I just couldn't pass up this opportunity to show off another terrific use for Kyma and the Capybara. - DM [PS: At high amplitude signal levels, and high enough Gamma, you actually get to hear the equation develop subharmonics of the input. My model wasn't lying to me after all... here they are!] [Another thought... Back again, when I was a kid in college, we tackled the inverted pendulum problem, which is a pendulum whose pivot point oscillates up and down at some freqeuency. We actually built one of these things using an old hand-held, motorized, jigsaw for the oscillating mount. What you find is that for selected lengths and oscillation frequencies, you get a pendulum that is stable in the upright position (upside down from a clock pendulum). The mathematics involve hairy pseudo-periodic functions known as Mathieu Functions. But we can quickly find the solutions for stable regions of length and frequency just by wiring up an analog computer and twidling the knobs. This might be a fun example to do on Kyma! ] [This message has been edited by David McClain (edited 14 April 2003).] IP: Logged | |
David McClain Member |
![]() ![]() ![]() ... actually, now that I have this Ear Equation running in Kyma, I discovered that the presence or absence of even harmonics has little to do with whether we use a peak detector or an RMS detector. What determines the presence of even harmonics is the use of a unipolar estimate. That half-wave rectifier in front of the peak detector is what does the trick. If you substitute an RMS detector after that rectifier, then you end up with almost the same result. A little more rounded in the sawtooth, but all harmonics nonetheless. For my money, having given a lot of thought to nerve action, I still think we have a peak detector running in our ears, not an energy detector. Computing a square root would be tough business for a neural network. But picking the strongest stimulus out of a collection is pretty straightforward. I still have to reconcile that crazy nonlinear exponent (3/2)! I have tried exponents of 2 and 5/2 as well, and find that one would be hard pressed to discern the difference between them. But anything 3 or larger causes real difficulties in that you never get a peaked response near the pitch of interest. All those higher exponents produce low-pass characteristics. Scaling that darn equation to run in different amplitude regimes is a real tough problem. When the input is allowed to assume values between 1 and 10^4, the Gamma factor is around 0.006. But when scaled to work on Kyma with a range of 10^-4 to 1, the Gamma factor ends up being only around 3-10, and the damping coefficient has to drop to around 0.25. The difficulty is caused by the nonlinearity -- that crazy exponent (3/2). Mathematica can be programmed to search for the best fitting values, but the fit is a tough one to pull off. By the way, have you all seen this? Those are some really neato movies! They only took a solid week of Supercomputer time to generate. Perhaps I need to delve further into what those movies are really saying, before I can understand that crazy exponent.... - DM IP: Logged | |
David McClain Member |
![]() ![]() ![]() ... BTW... when the Gamma factor is raised high enough to cause the subharmonics to appear on large amplitude signals, the system actually breaks into a "chaotic" regime. Chaos has a rather specific meaning in mathematics. It is defined as "constrained randomness". If you were to plot a Lissajous pattern with the tone output along one axis, and the time derivative of that tone along the other axis, you would see an almost-repeating pattern arise. It fills a rather large area in the Lissajous screen, but it never ventures outside of an imaginary boundary that your eye can see enclosing the pattern. Inside that boundary, the motion appears random in nature, never quite repeating over itself. But because it is confined to the inside of that "chatic attractor basin", we describe the system as "chaotic". Even prettier still, if you plot a 3-dimensional Lissajous, with the third dimension being the oscillator signal driving the system, then the locus of points where that oscillator reaches is peak value -- a slice of the 3-D Lissajous pattern, then you see a gorgeous example of a special kind of chaotic attractor basin. Such a slice of a 3-dimensional Lissajous pattern is known as a "Poincare` Section". If you can stand to listen to the sound being produced, it sounds like a bass note with a lot of harmonics, some subharmonic modulation, and a lot of noise beneath that. The fact that it doesn't sound like white noise is a hint that we have chaotic behavior. It turns out that this Ear Equation is vaguely related to another equation named after George Duffing. He found that the equation for a steel beam, clamped at the ends, and excited by a periodic signal, such as a vibrating machine part, there are certain regimes of signal amplitude and beam damping where the system breaks into chaotic oscillation. His equation is y'' + k*y' + y^3 = A*Cos(t) values for amplitue A = 7.5, and damping factor k = 0.05, produce this chaotic resonance. He discovered this back in the early 1800's around the start of the industrial era, when it was found that sometimes machinery emitted a horrible noise when the conditions were just right, er... wrong! Such resonances work to destroy the machine parts eventually. - DM [This message has been edited by David McClain (edited 15 April 2003).] IP: Logged | |
photonal Member |
![]() ![]() ![]() Thankyou David for the stimulating(!) posts - The link you posted ( http://pcbunn.cacr.caltech.edu/Cochlea/ ) is really interesting and the paper on the 3-D Cochlea model seems to answer a query of mine regarding my ears!! The paper mentions active amplification / otoacoustic emissions and could explain why I could quite easily switch off ( or cancel out!) any spontaneous high pitched noises in my ears. I found that if I listen to the sound (which seems to eminate from within the ear) then it quickly fades away. I've had this for a long long time but only recently wondered why and how I manage to overcome it. Looking at the model movies, it makes me wonder that by listening to the sound which seems to eminate from within my ear, then perhaps I am producing an otoacoustic emission in anti-phase to it - which then attenuates the original excitation, leading to its quiescence. Unfortunately, I don't know which equations are achieving this but at least my cochlea does! Andrew [This message has been edited by photonal (edited 15 April 2003).] IP: Logged | |
Pieter Member |
![]() ![]() ![]() Thank you for sharing your insight and information. very interesting!!! Pieter IP: Logged | |
David McClain Member |
![]() ![]() ![]() Hi Guys! You are quite welcome. The high pitch you describe sounds like Tinitus. I have it too. And it is a sign that you damaged your hearing as a youth, getting too close to the stage speakers at rock concerts no doubt... or else you like motorcycles like me too! Using very sensitive microphones allows us to actually measure acoustic energy emanating from the ear mechanisms. That tinitus actually exists inside your cochlea as an active sound source! But there is another aspect to what you describe in the way you cancel your tinitus. We humans are rather insensitive to constancy. Our senses depend on detecting changes in things -- this is true for touch, smell, visual sensations, and aural sensations. In fact, I remember an experiment where a white target board with a black square in the middle was placed on a servo controlled moveable stage in front of a human subject. The servo was fed signals that measured the eye motion -- very small jitter about 100 Hz. When the board was moved in synchrony with the eyeballs, the square target disappeared! So by focusing on the tinitus pitch, you are allowing your mind to "focus" and exclude nearly everything else, and before long, the constancy of the sound becomes its own nulling. We thrive on change, even when we don't much like it... Cheers! - DM IP: Logged |
All times are CT (US) | next newest topic | next oldest topic |
![]() ![]() |
This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.