in the original:
NB.  We'll sample a sine wave at 194.18 Hz over 1 second.
NB.  Or in other words: our x axis covers 194.18 radians,
NB.  and we'll choose our 8000 sample points from that range:

that's 8000 sample *points*

8000 sample points means 7999 sample *intervals*

ie. the range of (194.18 * 2p1 ) has
7999 sample intervals and 8000 sample points

so, in terms of proportion of a segment:
7999 intervals and 8000 points:
(i. % <:) 8000   NB. ranges from 0 .. 1

so ...

SamplePoints =. 1 o. (194.18 * 2p1 ) * (i. % <:) 8000



On 2011-07-15 03:09, [email protected] wrote:
> mijj>   yeh .. i always confuse samples with sample intervals too ..
> mijj>   should be ...
> mijj>   x =. 1 o. (194.18 * 2p1 ) * (i. %<:) 8000
>
> Should be not.  So, once more:
>
> The sample interval here is 1r8000 sec (=8kHz
> sampling).  For Ian, the one-second signal is "194.14 sine waves",
> and for direct treatment of "sin(x)" function with 1&o., the "x"
> values ("points where the samples are taken") for the periods have
> to be measured in the radians:
>
>       x =. (194.18 * 2p1 ) * (i. %<:) 8000
>
> At every sample point, the sample value ("sample") will be the
> sine value or some scaling thereof:
>
>       samples =.  ...   1 o. x
>
> Less confused now?
>
>                                               Martin Neitzel
>
> (Before submitting my code last night, I checked a 440 Hz version
> against my tuning fork.  You might get one before posting, too.)
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to