Newbie asking for a kickstart, please!
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
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
-
shakeshuck
- Posts: 30
- Joined: Tue Apr 18, 2017 12:36 pm
- Operating System: Windows 7
Newbie asking for a kickstart, please!
Sorry guys, I just can't get my head around how to start with this.
All I wish to do (to get me pointed in the right direction), is to average the value of each sequential pair in a wave form.
My guess was something like this:
( / ( + (first s) (first (rest s))) 2)
But I'm not sure if that just does the first two samples, and not the rest?
I tried creating a recursive loop (not knowing if it was needed or not), but just kept running into various errors.
Please can someone give me a hint as to what this should really look like if entered at the Nyquist prompt?
All I wish to do (to get me pointed in the right direction), is to average the value of each sequential pair in a wave form.
My guess was something like this:
( / ( + (first s) (first (rest s))) 2)
But I'm not sure if that just does the first two samples, and not the rest?
I tried creating a recursive loop (not knowing if it was needed or not), but just kept running into various errors.
Please can someone give me a hint as to what this should really look like if entered at the Nyquist prompt?
-
shakeshuck
- Posts: 30
- Joined: Tue Apr 18, 2017 12:36 pm
- Operating System: Windows 7
Re: Newbie asking for a kickstart, please!
Just for clarity, in case I'm using the wrong terminology, when I say 'first two samples' I mean the first two points on the waveform.
Re: Newbie asking for a kickstart, please!
Does this do what you want?
(http://www.cs.cmu.edu/~rbd/doc/nyquist/ ... l#index692)
(http://www.cs.cmu.edu/~rbd/doc/nyquist/ ... l#index692)
Code: Select all
;version 4
(snd-avg *track* 2 2 op-average)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
-
shakeshuck
- Posts: 30
- Joined: Tue Apr 18, 2017 12:36 pm
- Operating System: Windows 7
Re: Newbie asking for a kickstart, please!
Thanks, Steve - I think that's what I'm after, although it would be 2 1 in my case.
Trying to run it though doesn't seem to affect anything, and the debug prompt gives me this in the output:
error: bad argument type - #(#<Sound: #6920328> #<Sound: #6920568>)
Function: #<Subr-SND-AVG: #93ac2c8>
Arguments:
#(#<Sound: #6920328> #<Sound: #6920568>)
2
1
1
I do have 2 channels loaded, does that make a difference?
Also, does it matter what the original file type was (I assume once it's imported it's all the same to Audacity)?
Thanks.
Trying to run it though doesn't seem to affect anything, and the debug prompt gives me this in the output:
error: bad argument type - #(#<Sound: #6920328> #<Sound: #6920568>)
Function: #<Subr-SND-AVG: #93ac2c8>
Arguments:
#(#<Sound: #6920328> #<Sound: #6920568>)
2
1
1
I do have 2 channels loaded, does that make a difference?
Also, does it matter what the original file type was (I assume once it's imported it's all the same to Audacity)?
Thanks.
Re: Newbie asking for a kickstart, please!
That shows a stereo sound.shakeshuck wrote:error: bad argument type - #(#<Sound: #6920328> #<Sound: #6920568>)
Stereo sounds are handled as an array of two "sounds".
An "array of two sounds" is NOT a "sound", it's an "array" containing two "sounds".
The function SND-AVG requires a "sound" as the first argument (an "argument" just means one of the 'parameters' that is passed to the function).
Try it with a mono track.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
-
shakeshuck
- Posts: 30
- Joined: Tue Apr 18, 2017 12:36 pm
- Operating System: Windows 7
Re: Newbie asking for a kickstart, please!
Thanks Steve.
Due to your hint, I now have it working in stereo, and it does as expected.
Unfortunately I've also just discovered that although I can import DSF files with ffmpeg, I can't export them. *sigh*
Due to your hint, I now have it working in stereo, and it does as expected.
Unfortunately I've also just discovered that although I can import DSF files with ffmpeg, I can't export them. *sigh*
Re: Newbie asking for a kickstart, please!
Median filter ? Robert J. H made a plugin that does that ... http://forum.audacityteam.org/viewtopic ... 40#p250740shakeshuck wrote:All I wish to do (to get me pointed in the right direction), is to average the value of each sequential pair in a wave form.
-
shakeshuck
- Posts: 30
- Joined: Tue Apr 18, 2017 12:36 pm
- Operating System: Windows 7
Re: Newbie asking for a kickstart, please!
Hi Trebor,
Again, I'm not sure of the terminology, but I would say this averaging creates a variable high-pass filter; the higher the frequency, the more it is removed.
Again, I'm not sure of the terminology, but I would say this averaging creates a variable high-pass filter; the higher the frequency, the more it is removed.
Re: Newbie asking for a kickstart, please!
(snd-avg sound 2 1 op-average) gives a 'rolling average' of each sample with the previous sample, which acts as a low-pass filter where the corner frequency is 1/4 of the sample rate.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Newbie asking for a kickstart, please!
Here's the frequency response for a sample rate of 44100 Hz:
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)