slope not behaving as documented

Using Nyquist scripts in Audacity.
Post and download new plug-ins.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
Paul L
Posts: 1782
Joined: Mon Mar 11, 2013 7:37 pm
Operating System: Please select

slope not behaving as documented

Post by Paul L » Tue Oct 22, 2013 10:23 pm

Perhaps I am not looking at the most current documentation, but here:

http://www.cs.cmu.edu/~rbd/doc/nyquist/part8.html

I read:

slope(signal) [SAL]
(slope signal) [LISP]
Computes the first derivative (slope) of signal. The start time, sample rate, etc. are taken from signal.
But experiments suggests that the starting time is always zero. And the document should be more explicit that the slope of an n sample sound has n-1 samples, and its first sample is the slope of the segment connecting the first two samples of the input.

steve
Site Admin
Posts: 80679
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: slope not behaving as documented

Post by steve » Wed Oct 23, 2013 10:29 am

Paul L wrote:But experiments suggests that the starting time is always zero.
That's one of the differences between running standalone Nyquist and Nyquist in Audacity.
When running a Nyquist (process) effect in Audacity, the start of the selection becomes "time zero" for Nyquist, and warp is stretched so that the duration of the selection is one.
Paul L wrote:And the document should be more explicit that the slope of an n sample sound has n-1 samples, and its first sample is the slope of the segment connecting the first two samples of the input.
The Nyquist manual is part of the Nyquist project and is written by Professor Dannenberg. We don't have any influence over that. However, as a single point does not have a slope I don't think that this behaviour is unexpected.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Paul L
Posts: 1782
Joined: Mon Mar 11, 2013 7:37 pm
Operating System: Please select

Re: slope not behaving as documented

Post by Paul L » Wed Oct 23, 2013 2:57 pm

No, steve, I was not taking slope of s, but of a sound defined in Nyquist prompt with its starting time set to nonzero. Yet the result had 0 for its snd-t0.

Even if the result of slope did start at the same time as the input, it still needs a shift-time by half a sample interval, so that slope samples correspond more naturally to the midpoints.

I have occasion to calculate things from the downsampled sounds returned by snd-avg so this matters to me. Half the sample interval might be milliseconds, not 1/88200 s.

Post Reply