Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: <mszlazak@ao...>  20090628 01:02:20
Attachments:
Message as HTML

SNDMAXSAMP gives the maximum absolute value of a wave. Is there a signed (not absolute) version of this function? I'm dealing with waves of only negative valued amplitues so the maximum amplitude is the one closest to the axis. A absolute minimum function would work here as well. 
From: David R. Sky <davidsky@sh...>  20090628 02:29:12

Hi Dave, How about 'fudging' such a function: (defun mysndmaxsamp (s) (* 1.0 (sndminsamp (mult 1.0 s))) ) ; end defun Assuming of course that sndminsamp actually exists. And this would only be for your special case where the signal is at or below the zero axis. David  David R. Sky http://www.shellworld.net/~davidsky/ On Sat, 27 Jun 2009, mszlazak@... wrote: > SNDMAXSAMP gives the maximum absolute value of a wave. > Is there a signed (not absolute) version of this function? > I'm dealing with waves of only negative valued amplitues so the maximum amplitude is the one closest to the axis. A absolute minimum function would work here as well. > 
From: Roger Dannenberg <rbd@cs...>  20090628 02:59:29
Attachments:
Message as HTML

You can subtract your signal from a large number so that everything becomes positive and your minimum become the maximum. For related problems, you can also use sndmaxv to take only positive samples (or negative samples if you scale the input by 1) and then use sndmaxsamp to get only the most positive or most negative samples if the signal has both positive and negative samples. There's nothing in Nyquist now to take the minimum or maximum if you can't guarantee whether the value is positive or negative (but you can process the signal samplebysample, which is slow, but for such a simple calculation might be ok. Is should be substantially faster than real time). Roger mszlazak@... wrote: > SNDMAXSAMP gives the maximum absolute value of a wave. > Is there a signed (not absolute) version of this function? > I'm dealing with waves of only negative valued amplitues so the > maximum amplitude is the one closest to the axis. A absolute minimum > function would work here as well. > >  > *A Good Credit Score is 700 or Above. See yours in just 2 easy steps! > <http://pr.atwola.com/promoclk/100126575x1222585065x1201462786/aol?redir=http://www.freecreditreport.com/pm/default.aspx?sc=668072%26hmpgID=62%26bcd=JunestepsfooterNO62>;* > >  > >  > >  > > _______________________________________________ > Audacitynyquist mailing list > Audacitynyquist@... > https://lists.sourceforge.net/lists/listinfo/audacitynyquist > 
From: <mszlazak@ao...>  20090628 03:58:51
Attachments:
Message as HTML

Hi Roger, BTW, I think I figure out most of that paper we were exchanging on last week. It followed the work of one of the heavily cited references and as I implemented things others started to become clear. This led to this post and has to do with normalization of energy. Energy is estimated using g(t) = 10* lg (SUM of n frames in a 30 msec window centered on t) and here lg is the common logarithm. All my original audio signals s have absolute amplitudes less than 1 so the energy waveform of s is always negative. The least negative amplitude is the maximum value. At first glance, scaling by 1 seem right but isn't that a flip around the horizontal axis not a shift/slide up into positive ranges? To to the shift, I found the absolute maximum then added it to the energy signal, shifting it into positive ranges and then I found the maximum again. So a built in function would be nice. This second maximum value is part of a normalization procedure which then shifts the original energy signal g so it's minimum negative value is at zero. That's a part of the energy normalization they were referring to and had me scratching my head way the formula gave only zero and negative values. Anyway, thanks again for all that help last week. It was much appreciated. Mark. Original Message From: Roger Dannenberg <rbd@...> To: Discussion of developing Nyquist plugins for Audacity <audacitynyquist@...> Sent: Sat, Jun 27, 2009 7:59 pm Subject: Re: [Audacitynyquist] Is there a signed version of sndmaxsamp or absolute minimum function for sound? You can subtract your signal from a large number so that everything becomes positive and your minimum become the maximum. For related problems, you can also use sndmaxv to take only positive samples (or negative samples if you scale the input by 1) and then use sndmaxsamp to get only the most positive or most negative samples if the signal has both positive and negative samples. There's nothing in Nyquist now to take the minimum or maximum if you can't guarantee whether the value is positive or negative (but you can process the signal samplebysample, which is slow, but for such a simple calculation might be ok. Is should be substantially faster than real time). Roger mszlazak@... wrote: SNDMAXSAMP gives the maximum absolute value of a wave. Is there a signed (not absolute) version of this function? I'm dealing with waves of only negative valued amplitues so the maximum amplitude is the one closest to the axis. A absolute minimum function would work here as well. A Good Credit Score is 700 or Above. See yours in just 2 easy steps!  _______________________________________________ Audacitynyquist mailing list Audacitynyquist@... https://lists.sourceforge.net/lists/listinfo/audacitynyquist  _______________________________________________ Audacitynyquist mailing list Audacitynyquist@... https://lists.sourceforge.net/lists/listinfo/audacitynyquist 
From: <edgarrft@we...>  20090628 04:02:20

mszlazak@... schrieb: > SNDMAXSAMP gives the maximum absolute value of a wave. > Is there a signed (not absolute) version of this function? > I'm dealing with waves of only negative valued amplitues so the maximum > amplitude is the one closest to the axis. A absolute minimum function > would work here as well. > You can "invert" a sound (make the negative samples become positive and vice versa) by using Nyquist "scale" or "mult" with a factor of "1".  edgar 
From: <mszlazak@ao...>  20090628 04:04:55
Attachments:
Message as HTML

Thank you but this doesn't work. See my response to Roger. Original Message From: edgarrft@... To: Discussion of developing Nyquist plugins for Audacity <audacitynyquist@...> Sent: Sat, Jun 27, 2009 9:02 pm Subject: Re: [Audacitynyquist] Is there a signed version of sndmaxsamp or absolute minimum function for sound? mszlazak@... schrieb: > SNDMAXSAMP gives the maximum absolute value of a wave. > Is there a signed (not absolute) version of this function? > I'm dealing with waves of only negative valued amplitues so the maximum > amplitude is the one closest to the axis. A absolute minimum function > would work here as well. > You can "invert" a sound (make the negative samples become positive and vice versa) by using Nyquist "scale" or "mult" with a factor of "1".  edgar  _______________________________________________ Audacitynyquist mailing list Audacitynyquist@... https://lists.sourceforge.net/lists/listinfo/audacitynyquist 
From: <edgarrft@we...>  20090628 08:07:18

> Edgar wrote in a former mail: > You can "invert" a sound (make the negative samples become positive > and vice versa) by using Nyquist "scale" or "mult" with a factor > of "1". > Thank you but this doesn't work. See my response to Roger. Sorry, I was cleaning up my mailbox and hadn't realized that Roger already had answered before. > All my original audio signals s have absolute amplitudes > less than 1 so the energy waveform of s is always negative. I assume you're talking about "normalized float" samples (like used in Nyquist and Audacity) with maxPeak=1.0, minPeak=1.0, what leads to absolute peak values between min=0.0 and max=1.0, so lg(absPeak) is always negative. One of the first things I would try whould look like this: (scale 1 (slog (sabs sound))) > That's a part of the energy normalization they were referring to > and had me scratching my head way the formula gave only zero and > negative values. Who is "they"? Can you tell what document? Is it one of the CCRMA/JOSIII papers? I wasn't able to find out by reading the mails from last week. In Nyquist you often have to "compute around the corner", so maybe we need to rearrange the formula, but therefore I would need the complete context of the original paper. Other ideas: In Nyquist there is e.g. "sndavg", which can compute the RMSpower of blocks of samples.  edgar 
From: <mszlazak@ao...>  20090628 16:50:11
Attachments:
Message as HTML

Hi Edgar. The paper I mentioned is here: http://figment.csee.usf.edu/~sfefilat/data/papers/WeBT5.3.pdf and it cites this paper a lot which gave me clues to what's going on: http://lilabs.com/info/pdf/journal/aspept02.pdf Thanks. Mark. Original Message From: edgarrft@... To: Discussion of developing Nyquist plugins for Audacity <audacitynyquist@...> Sent: Sun, Jun 28, 2009 1:05 am Subject: Re: [Audacitynyquist] Is there a signed version of sndmaxsamp or absolute minimum function for sound? > Edgar wrote in a former mail: > You can "invert" a sound (make the negative samples become positive > and vice versa) by using Nyquist "scale" or "mult" with a factor > of "1". > Thank you but this doesn't work. See my response to Roger. Sorry, I was cleaning up my mailbox and hadn't realized that Roger already had answered before. > All my original audio signals s have absolute amplitudes > less than 1 so the energy waveform of s is always negative. I assume you're talking about "normalized float" samples (like used in Nyquist and Audacity) with maxPeak=1.0, minPeak=1.0, what leads to absolute peak values between min=0.0 and max=1.0, so lg(absPeak) is always negative. One of the first things I would try whould look like this: (scale 1 (slog (sabs sound))) > That's a part of the energy normalization they were referring to > and had me scratching my head way the formula gave only zero and > negative values. Who is "they"? Can you tell what document? Is it one of the CCRMA/JOSIII papers? I wasn't able to find out by reading the mails from last week. In Nyquist you often have to "compute around the corner", so maybe we need to rearrange the formula, but therefore I would need the complete context of the original paper. Other ideas: In Nyquist there is e.g. "sndavg", which can compute the RMSpower of blocks of samples.  edgar  _______________________________________________ Audacitynyquist mailing list Audacitynyquist@... https://lists.sourceforge.net/lists/listinfo/audacitynyquist 
From: paul beach <sniffyraven@fa...>  20090628 22:22:59

Sine of a sine does not seem to work, (hzosc (hzosc 11)) If something is moving in a frequency modulated field, it creates quite a commotion. It seems difficult to set up a car engine in Nyquist. http://www.climatehoax.ca/music/engine.mp3 Accelerating frequency, sin((t*55)^1.25+ 2*sin(3*(t*55)^1.25)) Not in rads; starting radian frequency is 55/(2*pi)  paul beach sniffyraven@... 
From: Roger Dannenberg <rbd@cs...>  20090629 03:11:27

What did you expect to get from this and what did you actually get? hzosc(hzosc(f)) is not the same as sin(sin(t)) paul beach wrote: > Sine of a sine does not seem to work, > (hzosc (hzosc 11)) > > If something is moving in a frequency modulated field, it creates quite > a commotion. It seems difficult to set up a car engine in Nyquist. > > 
From: paul beach <sniffyraven@fa...>  20090629 03:46:08

I expect sin(sin t) look like another sine wave. This: (hzosc (hzosc f)) attenuates the amplitude in proportion to the frequency, at f = 11, the amplitude is about 0.1 of full scale. This: (osc (osc 11)) does not return audio. Paul On Sun, 28 Jun 2009 23:11:16 0400, "Roger Dannenberg" <rbd@...> said: > What did you expect to get from this and what did you actually get? > hzosc(hzosc(f)) is not the same as sin(sin(t)) > > paul beach wrote: > > Sine of a sine does not seem to work, > > (hzosc (hzosc 11)) > > > > If something is moving in a frequency modulated field, it creates quite > > a commotion. It seems difficult to set up a car engine in Nyquist. > > > > > >  > _______________________________________________ > Audacitynyquist mailing list > Audacitynyquist@... > https://lists.sourceforge.net/lists/listinfo/audacitynyquist  paul beach sniffyraven@... 
From: Roger Dannenberg <rbd@cs...>  20090629 03:57:18

paul beach wrote: > I expect sin(sin t) look like another sine wave. > But we know from FM theory that the result has sidebands, so it cannot be a sine wave. > This: > (hzosc (hzosc f)) > attenuates the amplitude in proportion to the frequency, at f = 11, the > amplitude is about 0.1 of full scale. > That all sounds right to me  the instantaneous frequency of the "carrier" never exceeds one (the maximum value of the input), so the phase of the outer hzosc is going to wobble around zero. > This: (osc (osc 11)) does not return audio. > The first argument to OSC is a scalar step number, so this doesn't return anything, it generates an error. Roger 
From: paul beach <sniffyraven@fa...>  20090704 04:29:01

I was asked about equalizer and tried a 20khz signal. The spectrum drops about 30dB. Is it just my old Windows computer + sound card, that does that? To be expected since capacitive reactance is inversely propotional to frequency?  paul beach sniffyraven@... 
From: David R. Sky <davidsky@sh...>  20090704 06:00:48

Hi Paul, You didn't specify any of several parameters that can be 'fed' to a Nyquist equalizer function. There's at least one on my plugins page, a zip file with .ny plug and .txt help file, go to this section: http://www.shellworld.net/~davidsky/plugins.htm#misc There's at least one plug which uses eqband if I remember correctly, you need to specify center frequency, width of band in octaves, amount to boost or attenuate, and perhaps one or two other argument fields. David  David R. Sky http://www.shellworld.net/~davidsky/ On Fri, 3 Jul 2009, paul beach wrote: > I was asked about equalizer and tried a 20khz signal. The spectrum drops > about 30dB. Is it just my old Windows computer + sound card, that does > that? To be expected since capacitive reactance is inversely propotional > to frequency? > 
From: paul beach <sniffyraven@fa...>  20090730 22:44:47

Is piece wise linear supposed to work on filter parameters? Seems to work with low pass but not higher order filters. (lp (osctri 440) (mult (pwl .01 22 1 ) 11 ) )  paul beach sniffyraven@... 
From: David R. Sky <davidsky@sh...>  20090731 09:10:45

Hi Paul, Higherorder filters do not accept signals for cutoff frequency. You can of course create your own higherorder filter by embedding them in a defun such as (defun mylowpass4 (s hz) (lowpass (lowpass (lowpass (lowpass s hz) hz) hz) hz))))) ABove, hz can be a signal _or_ a flonum (float number). David  David R. Sky http://www.shellworld.net/~davidsky/ On Thu, 30 Jul 2009, paul beach wrote: > Is piece wise linear supposed to work on filter parameters? Seems to > work with low pass but not higher order filters. > > (lp > (osctri 440) > (mult (pwl .01 22 1 ) 11 ) > ) > 
From: paul beach <sniffyraven@fa...>  20090731 17:49:50

Can the slope of a triangle wave be modified, so that is, part triangle part sawtooth. A string plucked in the middle is triangular, but more sawtoothed toward the bridge. MP3 for triangle guitar sound http://www.climatehoax.ca/audio/bass_55.mp3 Nyquist guitar patch where damping is proprtional to variable frequency and constant air resistance. ; guitar (setf f 55.0 ) (lp (sim (osctri (* f 1) ) (osctri ( * f 2)) (scale .25 (osctri (* f 3))) ;(scale 1 (osctri (* f 4))) ) (mult (pwl ( / 1 f ) 1 0.25 (/ 2 (sqrt f ) ) 1 ) (/ f 2) ) )  paul beach sniffyraven@... 
From: David R. Sky <davidsky@sh...>  20090731 18:48:42

Hi Paul, Check the Design Waveform plug in a zip file on my site http://www.shellworld.net/~davidsky/design.zip It creates and generates a waveform using straight lines, and based on the general way to design your own waveform in Nyquist using straight lines and pwl. If you want to create a waveform that changes shape over time without using filters or an eq function for attenuating/boosting harmonics, I dunno at this time  probably simple to work out. David  David R. Sky http://www.shellworld.net/~davidsky/ On Fri, 31 Jul 2009, paul beach wrote: > Can the slope of a triangle wave be modified, so that is, part triangle > part sawtooth. A string plucked in the middle is triangular, but more > sawtoothed toward the bridge. > > MP3 for triangle guitar sound > > http://www.climatehoax.ca/audio/bass_55.mp3 > > Nyquist guitar patch where damping is proprtional to variable frequency > and constant air resistance. > > ; guitar > (setf f 55.0 ) > (lp > > (sim > (osctri (* f 1) ) > (osctri ( * f 2)) > (scale .25 (osctri (* f 3))) > ;(scale 1 (osctri (* f 4))) > > ) > (mult (pwl ( / 1 f ) 1 0.25 (/ 2 (sqrt f ) ) 1 ) (/ f 2) ) > ) > 
From: paul beach <sniffyraven@fa...>  20090731 20:02:16

Hello David, I think exponential decay would make your plugin sound like a harp or guitar depending on the slope of the triangle. In the program, my guess is that expdec would come after normalize, (normalize (lp (pwllist breakpoints) lpfreq))) Paul On Fri, 31 Jul 2009 11:48:31 0700 (PDT), "David R. Sky" <davidsky@...> said: > Hi Paul, > > Check the Design Waveform plug in a zip file on my site > > http://www.shellworld.net/~davidsky/design.zip > > It creates and generates a waveform using straight lines, and based on > the > general way to design your own waveform in Nyquist using straight lines > and pwl. > > If you want to create a waveform that changes shape over time without > using filters or an eq function for attenuating/boosting harmonics, I > dunno at this time  probably simple to work out. > > David > >  > David R. Sky > http://www.shellworld.net/~davidsky/ > > > On Fri, 31 Jul 2009, paul beach wrote: > > > Can the slope of a triangle wave be modified, so that is, part triangle > > part sawtooth. A string plucked in the middle is triangular, but more > > sawtoothed toward the bridge. > > > > MP3 for triangle guitar sound > > > > http://www.climatehoax.ca/audio/bass_55.mp3 > > > > Nyquist guitar patch where damping is proprtional to variable frequency > > and constant air resistance. > > > > ; guitar > > (setf f 55.0 ) > > (lp > > > > (sim > > (osctri (* f 1) ) > > (osctri ( * f 2)) > > (scale .25 (osctri (* f 3))) > > ;(scale 1 (osctri (* f 4))) > > > > ) > > (mult (pwl ( / 1 f ) 1 0.25 (/ 2 (sqrt f ) ) 1 ) (/ f 2) ) > > ) > > > >  > Let Crystal Reports handle the reporting  Free Crystal Reports 2008 > 30Day > trial. Simplify your report design, integration and deployment  and > focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobjjuly > _______________________________________________ > Audacitynyquist mailing list > Audacitynyquist@... > https://lists.sourceforge.net/lists/listinfo/audacitynyquist  paul beach sniffyraven@... 
From: Roger Dannenberg <rbd@cs...>  20090804 15:59:35

Paul, The result of PWL is a SOUND type. Most filters accept arguments of type SOUND, so the general answer is yes. If something seems wrong, please read the documentation to see what the behavior should be. In general, this can take several directions: 1) Nyquist is correct as documented, but you'd like it to behave differently. 2) Nyquist is incorrect as documented, but the documentation is wrong. 3) Nyquist is incorrect as documented because of a bug. It's usually my call to distinguish between 2 and 3. Usually, it's (2) because the documentation is just ambiguous or incomplete. Roger paul beach wrote: > Is piece wise linear supposed to work on filter parameters? Seems to > work with low pass but not higher order filters. > > (lp > (osctri 440) > (mult (pwl .01 22 1 ) 11 ) > ) > 
From: paul beach <sniffyraven@fa...>  20090807 22:57:52

I see two filters accept a "signal" in addition to flonum. It that case, triangle may be modified to mimic the way higher frequencies damp faster. In this case, exponential decay is applied to the center of reson filter. The manual specs are correct as documented. Perhaps moving filter might un alias straight line waveforms. ; ukulele note (setf f ( steptohz 70 ) ) ;(reson sound center bandwidth n) (reson (sim (osctri (* f 1) ) (osctri ( * f 2)) (scale .25 (osctri (* f 3))) ) (mult (expdec 0 ( / 45.0 f ) 1 ) f ) 50 1) On Tue, 04 Aug 2009 11:59:25 0400, "Roger Dannenberg" <rbd@...> said: > Paul, > The result of PWL is a SOUND type. Most filters accept arguments of > type SOUND, so the general answer is yes. If something seems wrong, > please read the documentation to see what the behavior should be. In > general, this can take several directions: > 1) Nyquist is correct as documented, but you'd like it to behave > differently. > 2) Nyquist is incorrect as documented, but the documentation is > wrong. > 3) Nyquist is incorrect as documented because of a bug. > It's usually my call to distinguish between 2 and 3. Usually, it's (2) > because the documentation is just ambiguous or incomplete. > Roger > > > paul beach wrote: > > Is piece wise linear supposed to work on filter parameters? Seems to > > work with low pass but not higher order filters. > > > > (lp > > (osctri 440) > > (mult (pwl .01 22 1 ) 11 ) > > ) > > > >  > Let Crystal Reports handle the reporting  Free Crystal Reports 2008 > 30Day > trial. Simplify your report design, integration and deployment  and > focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobjjuly > _______________________________________________ > Audacitynyquist mailing list > Audacitynyquist@... > https://lists.sourceforge.net/lists/listinfo/audacitynyquist  paul beach sniffyraven@... 
From: Roger Dannenberg <rbd@cs...>  20090808 11:54:40

Unfortunately, you can't normally "fix" aliased frequencies with filters. The high frequencies implied by corners of straightline waveforms "fold over" into lower frequencies below half the sample rate (the Nyquist rate). Usually, the worst aliases are at high frequencies, so lowpassing the signal does help in practice even if it cannot eliminate the problem. Yamaha used this trick in their FM synthesizers: it's hard to control the bandwidth of FM so at least some of their synthesizers used a sample rate around 80kHz. Since they lowpassed the output at 20kHz, you would only hear aliases from frequencies above 60kHz (60kHz and above aliased to 20kHz and below). You can do the same thing in Nyquist: use a sample rate of 88.2kHz for example and resample (using RESAMPLE) to 44.1kHz. Use RESAMPLE rather than the default linear interpolation to change sample rates because resampling itself will introduce aliasing. Again, this will reduce the audible aliasing if the true spectrum you start with falls off at higher frequencies, but is will not affect the aliased frequencies that are in the audible range. Roger paul beach wrote: > I see two filters accept a "signal" in addition to flonum. It that case, > triangle may be modified to mimic the way higher frequencies damp > faster. In this case, exponential decay is applied to the center of > reson filter. The manual specs are correct as documented. Perhaps moving > filter might un alias straight line waveforms. > > ; ukulele note > (setf f ( steptohz 70 ) ) > ;(reson sound center bandwidth n) > (reson > (sim > (osctri (* f 1) ) > (osctri ( * f 2)) > (scale .25 (osctri (* f 3))) > ) > (mult (expdec 0 ( / 45.0 f ) 1 ) f ) > 50 1) > > On Tue, 04 Aug 2009 11:59:25 0400, "Roger Dannenberg" <rbd@...> > said: > >> Paul, >> The result of PWL is a SOUND type. Most filters accept arguments of >> type SOUND, so the general answer is yes. If something seems wrong, >> please read the documentation to see what the behavior should be. In >> general, this can take several directions: >> 1) Nyquist is correct as documented, but you'd like it to behave >> differently. >> 2) Nyquist is incorrect as documented, but the documentation is >> wrong. >> 3) Nyquist is incorrect as documented because of a bug. >> It's usually my call to distinguish between 2 and 3. Usually, it's (2) >> because the documentation is just ambiguous or incomplete. >> Roger >> >> >> paul beach wrote: >> >>> Is piece wise linear supposed to work on filter parameters? Seems to >>> work with low pass but not higher order filters. >>> >>> (lp >>> (osctri 440) >>> (mult (pwl .01 22 1 ) 11 ) >>> ) >>> >>> >>  >> Let Crystal Reports handle the reporting  Free Crystal Reports 2008 >> 30Day >> trial. Simplify your report design, integration and deployment  and >> focus on >> what you do best, core application coding. Discover what's new with >> Crystal Reports now. http://p.sf.net/sfu/bobjjuly >> _______________________________________________ >> Audacitynyquist mailing list >> Audacitynyquist@... >> https://lists.sourceforge.net/lists/listinfo/audacitynyquist >> 
From: <mszlazak@ao...>  20090628 22:02:25
Attachments:
Message as HTML

BTW Edgar, below is what I have so far. If I've got things right to now then I still need to add together normalized energy and normalized edge information. After that would be the automaton part. Learning as I go. Roger D. was very helpful and gave me a couple items that may make this all work with different energy calculations:  "All these measures are related  peak absolute value, average of squared signal, square root of average, etc. For a given type of sound (like speech) peak amplitude is generally a constant factor different from the RMS amplitude, and once you take logs, that constant factor becomes an offset, and whether you work with intensity (amplitude) or power (amplitude squared) is just a scale factor. The "normal" thing is use RMS because RMS squared is average power (energy / time), but it would not be too surprising to use some other related measure. ... log(x) is monotonic: x > y > 0 => log(x) > log(y), so if you want the max(log(x)) you can take log(max(x)), provided x > 0."  (defun cubic (frame windowsize) ??? (let ??? ??? ??? ( ??? ??? ??? (k (/ 27.0 16.0))??? ??? ??? ??? ??? (i (round (* frame (/ 2581.0 (1 windowsize))))) ??? ??? ) ??????????????? (cond ((> i 1290) (setf i 1290)) ((< i 1290) (setf i 1290))) ??? ??? (* k (+ (* i i i) (* 2.0 i i) i)) ??? ) ) (defun energy (s windowsize framesize) ??? (scale 4.34294481 (sndlog (sndavg (mult s s) windowsize framesize OPAVERAGE))) ) (defun normg (g) ??????? (setf neg (scale 1 g)) ??? (setf shift (sndmaxsamp (sndmaxv neg (const 0.0 (sndlength neg 10000000))))) ??? (if (> shift 0.0) (setf g (sum g shift))) ??? (setf gmax (sndmaxsamp g)) ??? (scale (/ 20.0 gmax) (diff g gmax)) ) (defun makefilter (rate) ??? (setf arf (makearray 15)) ??? (dotimes (i 15) ??? ??? ??? (setf frame ( i 7)) ??? ??? ??? (setf (aref arf i) (cubic frame 15)) ??? ) ??? (sndfromarray 0 rate arf) ) (setf g (energy s 240 80)) (setf gnorm (normg g)) (setf f (makefilter (sndsrate g))) (setf edge (convolve g f)) (setf edgenorm (scale (/ 1.0 (sndmaxsamp edge)) edge)) Original Message From: edgarrft@... To: Discussion of developing Nyquist plugins for Audacity <audacitynyquist@...> Sent: Sun, Jun 28, 2009 1:05 am Subject: Re: [Audacitynyquist] Is there a signed version of sndmaxsamp or absolute minimum function for sound? > Edgar wrote in a former mail: > You can "invert" a sound (make the negative samples become positive > and vice versa) by using Nyquist "scale" or "mult" with a factor > of "1". > Thank you but this doesn't work. See my response to Roger. Sorry, I was cleaning up my mailbox and hadn't realized that Roger already had answered before. > All my original audio signals s have absolute amplitudes > less than 1 so the energy waveform of s is always negative. I assume you're talking about "normalized float" samples (like used in Nyquist and Audacity) with maxPeak=1.0, minPeak=1.0, what leads to absolute peak values between min=0.0 and max=1.0, so lg(absPeak) is always negative. One of the first things I would try whould look like this: (scale 1 (slog (sabs sound))) > That's a part of the energy normalization they were referring to > and had me scratching my head way the formula gave only zero and > negative values. Who is "they"? Can you tell what document? Is it one of the CCRMA/JOSIII papers? I wasn't able to find out by reading the mails from last week. In Nyquist you often have to "compute around the corner", so maybe we need to rearrange the formula, but therefore I would need the complete context of the original paper. Other ideas: In Nyquist there is e.g. "sndavg", which can compute the RMSpower of blocks of samples.  edgar  _______________________________________________ Audacitynyquist mailing list Audacitynyquist@... https://lists.sourceforge.net/lists/listinfo/audacitynyquist 
From: Roger Dannenberg <rbd@cs...>  20090628 22:07:30

Is there a signed version of sndmaxsamp or absolute minimum function for sound? No. You can use sndmaxv and sndminv to remove the negative or positive part of a signal, but it only helps you find the minimum if you know the minimum is negative. Roger 
From: paul beach <sniffyraven@fa...>  20090704 12:52:09

I was checking the frequency response of the sound card. It should fail somwhere at greater than 20khz because of Shanon's theorem. David's Buzz generator was used, with frequencies set from 1000 to 21000 in steps of a thousand. http://www.shellworld.net/~davidsky/buzz.zip Amplitude is set at .5 My respone is flat up to 19 khz and then takes off after that. It may be that some sound cards trap or equalize so that it does not alias and create a hash around 10 khz. On Fri, 03 Jul 2009 21:28:58 0700, "paul beach" <sniffyraven@...> said: > I was asked about equalizer and tried a 20khz signal. The spectrum drops > about 30dB. Is it just my old Windows computer + sound card, that does > that? To be expected since capacitive reactance is inversely propotional > to frequency? >  > paul beach > sniffyraven@... > > >  > _______________________________________________ > Audacitynyquist mailing list > Audacitynyquist@... > https://lists.sourceforge.net/lists/listinfo/audacitynyquist  paul beach sniffyraven@... 