I was thinking about which two musical notes, when played together, maximize the absolute value of the area under the curve of the resulting wave within its period while keeping the amplitude to a minimum (ideally the amplitude of the original two sound waves). I guess you could try to maximize [tex] f(\omega,z)=\int_0^T{}|cos(t)+cos(\omega{}t+z)|dt [/tex] with respect to ##\omega## and ##z##, while keeping the amplitude of ##cos(t)+cos(\omega{}t+z)## equal to ##1##. But I have no idea how to go about it. Also, I am not looking for particular frequencies.. I guess what matters is the difference between the frequencies since I am only considering the area within their periods. Thanks!
What period are you talking about? Two different frequencies have two different periods. Is it the period of the beat arising from the sum? Could you try to be more specific about what the area represents you are mentioning? Maximum area with minimum amplitude sounds to me like you are looking for a square wave.
Say I play a G1 (49 Hz) at 0 dB (1 amplitude ratio), which other note do I have to play in order to minimize the destructive interference while also keeping the amplitude to a minimum. So, for instance, a G2 (98 Hz) played together with that G1 would result in a wave with maximum amplitude 6 dB (amplitude ratio of 2), but ideally the resulting amplitude should't clip beyond 0 dB. So I could play a shifted G1 that would completely cancel out the original G1, but that is completely destructive interference.. I want to minimize this destructive behavior. Basically, I want to know which frequency and phase the other wave has to have in order to get the best of both worlds.
If you have two incommensurate frequencies (that is, not some perfect ratio), then the initial phase doesn't matter and you always have twice the amplitude maximum. But, I agree with elegy, it sounds like you want to approximate a square wave.
I don't know a simple answer. My approach would be to use matlab and just evaluate [tex] f(\omega,z)=\int_0^T{}|cos(t)+cos(\omega{}t+z)|dt [/tex] for some T much greater than the period of the beat. This way the phase won't matter because it will average out. You could do this with a simple for/if loop. for example, wmax = 0; intmax = 0; t=0:.001:100; for w = 1:10:10000 f=abs(cos(t)+cos(w.*t)); intf = trapz(t,f)); if intf > intmax intmax = intf; wmax = w; end end wmax will hold the frequency which maximizes the sum, intmax will hold the area of the maximized integral. That should work over the frequency range 1/2pi to 10k/2pi Hz, due to specifying w = 1:10000. You could create a new variable for the other frequency, and then see if the ratio depends on the fixed w. You could get fancy here and have it plot the area vs w. Now we're cookin' lol I don't have a copy of matlab on this pc, so this is from memory. It might need some tweaks if you actually try to run that.
I don't know matlab.. so some of what you said went completely over my head, but are you saying I should try to do some numerical integration and wait until the value of the integral reaches a maximum and starts decreasing back again? If that is the case, how do I know that would be a global maximum not a local one? After all we are dealing with periodic functions. Thanks!
yeah, numerical integration. If you can do a little programming like that, you can plot the area of the integral as a function of the frequency to find an approximate answer to your question. As for whether it's global, just cover a large range of frequencies to be sure. This way of doing things isn't a formal proof. I wonder though, whether the ratio is constant or dependent on the fixed ω. It's also very possible too that the area is max only when the two frequencies are equal (not considering frequencies less than the fixed ω).
I ran it in matlab. I changed a few things, but the equation used is shown in the plots. There's 3 plots, at different scales. as you can see, the maximum occurs when the frequencies are equal.