## audacity-nyquist

 [Audacity-nyquist] Is there a signed version of snd-maxsamp or absolute minimum function for sound? From: - 2009-06-28 01:02:20 Attachments: Message as HTML ```SND-MAXSAMP 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. ```
 Re: [Audacity-nyquist] Is there a signed version of snd-maxsamp or absolute minimum function for sound? From: David R. Sky - 2009-06-28 02:29:12 ```Hi Dave, How about 'fudging' such a function: (defun my-snd-maxsamp (s) (* -1.0 (snd-minsamp (mult -1.0 s))) ) ; end defun Assuming of course that snd-minsamp 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: > SND-MAXSAMP 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. > ```
 Re: [Audacity-nyquist] Is there a signed version of snd-maxsamp or absolute minimum function for sound? From: Roger Dannenberg - 2009-06-28 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 snd-maxv to take only positive samples (or negative samples if you scale the input by -1) and then use snd-maxsamp 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 sample-by-sample, which is slow, but for such a simple calculation might be ok. Is should be substantially faster than real time). -Roger mszlazak@... wrote: > SND-MAXSAMP 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! > ;* > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > > ------------------------------------------------------------------------ > > _______________________________________________ > Audacity-nyquist mailing list > Audacity-nyquist@... > https://lists.sourceforge.net/lists/listinfo/audacity-nyquist > ```
 Re: [Audacity-nyquist] Is there a signed version of snd-maxsamp or absolute minimum function for sound? From: - 2009-06-28 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 To: Discussion of developing Nyquist plug-ins for Audacity Sent: Sat, Jun 27, 2009 7:59 pm Subject: Re: [Audacity-nyquist] Is there a signed version of snd-maxsamp 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 snd-maxv to take only positive samples (or negative samples if you scale the input by -1) and then use snd-maxsamp 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 sample-by-sample, which is slow, but for such a simple calculation might be ok. Is should be substantially faster than real time). -Roger mszlazak@... wrote: SND-MAXSAMP 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! ------------------------------------------------------------------------------ _______________________________________________ Audacity-nyquist mailing list Audacity-nyquist@... https://lists.sourceforge.net/lists/listinfo/audacity-nyquist ------------------------------------------------------------------------------ _______________________________________________ Audacity-nyquist mailing list Audacity-nyquist@... https://lists.sourceforge.net/lists/listinfo/audacity-nyquist ```
 Re: [Audacity-nyquist] Is there a signed version of snd-maxsamp or absolute minimum function for sound? From: - 2009-06-28 04:02:20 ``` mszlazak@... schrieb: > SND-MAXSAMP 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 ```
 Re: [Audacity-nyquist] Is there a signed version of snd-maxsamp or absolute minimum function for sound? From: - 2009-06-28 04:04:55 Attachments: Message as HTML ``` Thank you but this doesn't work. See my response to Roger. -----Original Message----- From: edgar-rft@... To: Discussion of developing Nyquist plug-ins for Audacity Sent: Sat, Jun 27, 2009 9:02 pm Subject: Re: [Audacity-nyquist] Is there a signed version of snd-maxsamp or absolute minimum function for sound? mszlazak@... schrieb: > SND-MAXSAMP 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 ------------------------------------------------------------------------------ _______________________________________________ Audacity-nyquist mailing list Audacity-nyquist@... https://lists.sourceforge.net/lists/listinfo/audacity-nyquist ```
 Re: [Audacity-nyquist] Is there a signed version of snd-maxsamp or absolute minimum function for sound? From: - 2009-06-28 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 (s-log (s-abs 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 re-arrange the formula, but therefore I would need the complete context of the original paper. Other ideas: In Nyquist there is e.g. "snd-avg", which can compute the RMS-power of blocks of samples. - edgar ```
 Re: [Audacity-nyquist] Is there a signed version of snd-maxsamp or absolute minimum function for sound? From: - 2009-06-28 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/asp-ept02.pdf Thanks. Mark. -----Original Message----- From: edgar-rft@... To: Discussion of developing Nyquist plug-ins for Audacity Sent: Sun, Jun 28, 2009 1:05 am Subject: Re: [Audacity-nyquist] Is there a signed version of snd-maxsamp 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 (s-log (s-abs 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 re-arrange the formula, but therefore I would need the complete context of the original paper. Other ideas: In Nyquist there is e.g. "snd-avg", which can compute the RMS-power of blocks of samples. - edgar ------------------------------------------------------------------------------ _______________________________________________ Audacity-nyquist mailing list Audacity-nyquist@... https://lists.sourceforge.net/lists/listinfo/audacity-nyquist ```
 [Audacity-nyquist] sine of sine don't work From: paul beach - 2009-06-28 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@... ```
 Re: [Audacity-nyquist] sine of sine don't work From: Roger Dannenberg - 2009-06-29 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. > > ```
 Re: [Audacity-nyquist] sine of sine don't work From: paul beach - 2009-06-29 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" 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. > > > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Audacity-nyquist mailing list > Audacity-nyquist@... > https://lists.sourceforge.net/lists/listinfo/audacity-nyquist -- paul beach sniffyraven@... ```
 Re: [Audacity-nyquist] sine of sine don't work From: Roger Dannenberg - 2009-06-29 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 ```
 [Audacity-nyquist] Equalizer From: paul beach - 2009-07-04 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@... ```
 Re: [Audacity-nyquist] Equalizer From: David R. Sky - 2009-07-04 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 plug-ins page, a zip file with .ny plug and .txt help file, go to this section: http://www.shellworld.net/~davidsky/plug-ins.htm#misc There's at least one plug which uses eq-band 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? > ```
 [Audacity-nyquist] pwl and filters From: paul beach - 2009-07-30 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 (osc-tri 440) (mult (pwl .01 22 1 ) 11 ) ) -- paul beach sniffyraven@... ```
 Re: [Audacity-nyquist] pwl and filters From: David R. Sky - 2009-07-31 09:10:45 ```Hi Paul, Higher-order filters do not accept signals for cutoff frequency. You can of course create your own higher-order filter by embedding them in a defun such as (defun my-lowpass4 (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 > (osc-tri 440) > (mult (pwl .01 22 1 ) 11 ) > ) > ```
 [Audacity-nyquist] modified osc-tri From: paul beach - 2009-07-31 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 (osc-tri (* f 1) ) (osc-tri ( * f 2)) (scale .25 (osc-tri (* f 3))) ;(scale 1 (osc-tri (* f 4))) ) (mult (pwl ( / 1 f ) 1 0.25 (/ 2 (sqrt f ) ) 1 ) (/ f 2) ) ) -- paul beach sniffyraven@... ```
 Re: [Audacity-nyquist] modified osc-tri From: David R. Sky - 2009-07-31 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 > (osc-tri (* f 1) ) > (osc-tri ( * f 2)) > (scale .25 (osc-tri (* f 3))) > ;(scale 1 (osc-tri (* f 4))) > > ) > (mult (pwl ( / 1 f ) 1 0.25 (/ 2 (sqrt f ) ) 1 ) (/ f 2) ) > ) > ```
 [Audacity-nyquist] Probably similar From: paul beach - 2009-07-31 20:02:16 ```Hello David, I think exponential decay would make your plug-in sound like a harp or guitar depending on the slope of the triangle. In the program, my guess is that exp-dec would come after normalize, (normalize (lp (pwl-list breakpoints) lp-freq))) Paul On Fri, 31 Jul 2009 11:48:31 -0700 (PDT), "David R. Sky" 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 > > (osc-tri (* f 1) ) > > (osc-tri ( * f 2)) > > (scale .25 (osc-tri (* f 3))) > > ;(scale 1 (osc-tri (* 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 > 30-Day > 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/bobj-july > _______________________________________________ > Audacity-nyquist mailing list > Audacity-nyquist@... > https://lists.sourceforge.net/lists/listinfo/audacity-nyquist -- paul beach sniffyraven@... ```
 Re: [Audacity-nyquist] pwl and filters From: Roger Dannenberg - 2009-08-04 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 > (osc-tri 440) > (mult (pwl .01 22 1 ) 11 ) > ) > ```
 [Audacity-nyquist] pwl and filters From: paul beach - 2009-08-07 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 ( step-to-hz 70 ) ) ;(reson sound center bandwidth n) (reson (sim (osc-tri (* f 1) ) (osc-tri ( * f 2)) (scale .25 (osc-tri (* f 3))) ) (mult (exp-dec 0 ( / 45.0 f ) 1 ) f ) 50 1) On Tue, 04 Aug 2009 11:59:25 -0400, "Roger Dannenberg" 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 > > (osc-tri 440) > > (mult (pwl .01 22 1 ) 11 ) > > ) > > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day > 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/bobj-july > _______________________________________________ > Audacity-nyquist mailing list > Audacity-nyquist@... > https://lists.sourceforge.net/lists/listinfo/audacity-nyquist -- paul beach sniffyraven@... ```
 Re: [Audacity-nyquist] pwl and filters From: Roger Dannenberg - 2009-08-08 11:54:40 ```Unfortunately, you can't normally "fix" aliased frequencies with filters. The high frequencies implied by corners of straight-line waveforms "fold over" into lower frequencies below half the sample rate (the Nyquist rate). Usually, the worst aliases are at high frequencies, so low-passing 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 low-passed 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 ( step-to-hz 70 ) ) > ;(reson sound center bandwidth n) > (reson > (sim > (osc-tri (* f 1) ) > (osc-tri ( * f 2)) > (scale .25 (osc-tri (* f 3))) > ) > (mult (exp-dec 0 ( / 45.0 f ) 1 ) f ) > 50 1) > > On Tue, 04 Aug 2009 11:59:25 -0400, "Roger Dannenberg" > 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 >>> (osc-tri 440) >>> (mult (pwl .01 22 1 ) 11 ) >>> ) >>> >>> >> ------------------------------------------------------------------------------ >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 >> 30-Day >> 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/bobj-july >> _______________________________________________ >> Audacity-nyquist mailing list >> Audacity-nyquist@... >> https://lists.sourceforge.net/lists/listinfo/audacity-nyquist >> ```
 Re: [Audacity-nyquist] Is there a signed version of snd-maxsamp or absolute minimum function for sound? From: - 2009-06-28 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 window-size) ??? (let ??? ??? ??? ( ??? ??? ??? (k (/ 27.0 16.0))??? ??? ??? ??? ??? (i (round (* frame (/ 2581.0 (1- window-size))))) ??? ??? ) ??????????????? (cond ((> i 1290) (setf i 1290)) ((< i -1290) (setf i -1290))) ??? ??? (* k (+ (* i i i) (* 2.0 i i) i)) ??? ) ) (defun energy (s window-size frame-size) ??? (scale 4.34294481 (snd-log (snd-avg (mult s s) window-size frame-size OP-AVERAGE))) ) (defun norm-g (g) ??????? (setf neg (scale -1 g)) ??? (setf shift (snd-maxsamp (snd-maxv neg (const 0.0 (snd-length neg 10000000))))) ??? (if (> shift 0.0) (setf g (sum g shift))) ??? (setf gmax (snd-maxsamp g)) ??? (scale (/ 20.0 gmax) (diff g gmax)) ) (defun make-filter (rate) ??? (setf ar-f (make-array 15)) ??? (dotimes (i 15) ??? ??? ??? (setf frame (- i 7)) ??? ??? ??? (setf (aref ar-f i) (cubic frame 15)) ??? ) ??? (snd-from-array 0 rate ar-f) ) (setf g (energy s 240 80)) (setf gnorm (norm-g g)) (setf f (make-filter (snd-srate g))) (setf edge (convolve g f)) (setf edgenorm (scale (/ 1.0 (snd-maxsamp edge)) edge)) -----Original Message----- From: edgar-rft@... To: Discussion of developing Nyquist plug-ins for Audacity Sent: Sun, Jun 28, 2009 1:05 am Subject: Re: [Audacity-nyquist] Is there a signed version of snd-maxsamp 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 (s-log (s-abs 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 re-arrange the formula, but therefore I would need the complete context of the original paper. Other ideas: In Nyquist there is e.g. "snd-avg", which can compute the RMS-power of blocks of samples. - edgar ------------------------------------------------------------------------------ _______________________________________________ Audacity-nyquist mailing list Audacity-nyquist@... https://lists.sourceforge.net/lists/listinfo/audacity-nyquist ```
 Re: [Audacity-nyquist] Is there a signed version of snd-maxsamp or absolute minimum function for sound? From: Roger Dannenberg - 2009-06-28 22:07:30 ``` Is there a signed version of snd-maxsamp or absolute minimum function for sound? No. You can use snd-maxv and snd-minv 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 ```
 Re: [Audacity-nyquist] requency response From: paul beach - 2009-07-04 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" 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@... > > > ------------------------------------------------------------------------------ > _______________________________________________ > Audacity-nyquist mailing list > Audacity-nyquist@... > https://lists.sourceforge.net/lists/listinfo/audacity-nyquist -- paul beach sniffyraven@... ```
1 2 > >> (Page 1 of 2)