robert bristow-johnson wrote:> Andor wrote: > > robert bristow-johnson wrote: > > ... > > > i'm wondering - did anyone run my MATLAB program? you can use the > > > axis() command to zoom in and look at the waveform. > > > > Yes. A normal square wave I get with this code: > > > > % x = x - (1/n)*cos(2*pi*(n*f0+detune)*t); > > x = x - (1/n)*cos(2*pi*(n*f0)*t); > > > > The wave that your original code > > > > x = x - (1/n)*cos(2*pi*(n*f0+detune)*t); > > % x = x - (1/n)*cos(2*pi*(n*f0)*t); > > > > generates sounds like a flanged version of the first. Very audible > > difference. > > try it with a reduced number of harmonics. maybe with max_harmonic = > 10.With max_harmonic = 10, the "flanging" effect is still audible, albeit only over headphones. I can't hear it when I compare the two sound files over speakers. Then again, the construction work outside my window isn't making audibility tests very reliable ... Nice test, thanks. Regards, Andor> > r b-j

# Importance of phase in Audio

Started by ●July 26, 2006

Reply by ●July 28, 20062006-07-28

Reply by ●July 28, 20062006-07-28

Andor wrote:> > With max_harmonic = 10, the "flanging" effect is still audible, albeit > only over headphones.make sure you changed it on the MATLAB command line:>>max_harmonic = 10; >>square_phasebecause, if you ran it with: if ~exist('max_harmonic') max_harmonic = floor((Fs/2)/f0) - 1 end then changed it to if ~exist('max_harmonic') max_harmonic = 10 end and ran it again without>>clearthen the old number would still be used.> I can't hear it when I compare the two sound > files over speakers. Then again, the construction work outside my > window isn't making audibility tests very reliable ...another thing to do is to slow down the change rate. if there is a change rate that is slow enough that you can't hear the difference, that still means that you can't hear the absolute phase difference.> Nice test, thanks.just to reiterate, my side of this little dispute was that phase *was* or *is* or *can be* perceptually salient. i just thought that this was a useful example of where this perception is difficult (granting that to the other side). but, even in this case, since the waveforms are clearly different, you toss in sufficient non-linearity, and you'll hear a difference. that, plus the other cases (detuning) is where i based my claim that Andrew Horner did not sufficiently justify setting the phase angles of all of his harmonics to zero at the outset of all of his wavetable synthesis work. i believe he has not addressed this, even in his response to my letter to the AES editor 3 years ago. r b-j

Reply by ●July 30, 20062006-07-30

mailprassi@gmail.com wrote:> i am designing a low pass filter and high pass filter to pass my > audio samples. in matlab i checked out both butterworth and > chebyshev(cheby2) 3rd order filter. > I have observed there is a lot of differance in the phase plot of > both the filters. > Now my query went to what actuall effect of phase in audio? please > anybody help me in solving this.As I understand it, phase shifts are audible, but much less than many other effects that can happen to a signal. It was explained to me that at low frequencies the nerve impulses are generated once per cycle at a fairly fixed point on the cycle. At higher frequencies nerve impulses are not generated on each cycle, but once every few cycles, and again at an approximately fixed position in the cycle. If phase wasn't important to evolution, there wouldn't be any reason for us to be sensitive to it. Sensing the direction of a sound source is important, and in one dimension can be done by the time difference in arrival between the two ears. Phase shifts that are the same between left and right won't affect that much. Sensing direction on a different axis is a complicated function of the frequency spectra due to the shape of the outer ear. There might be some effects of phase on that, though in a stereo signal there won't be any such signal left. Some audiophiles like to make a big thing about phase, sometimes even absolute phase. (A 180 degree phase shift in both channels.) I mostly don't believe phase is important. -- glen