Page 1 of 1

Selection f(samples)

Posted: Wed Oct 05, 2016 10:11 am
by HpW
Why selecting samples from 0...4096 is really 1..4096 ??

Hp

Re: Selection f(samples)

Posted: Wed Oct 05, 2016 2:13 pm
by DougDbug
It's a computer/programming tradition to start counting at zero. If you are addressing memory there truly is an address zero location in hardware and in an audio file sample zero also exists. i.e. with 4 bits we can count from binary 0000 (decimal zero) to 1111 (decimal 15 or hexadecimal F).

Re: Selection f(samples)

Posted: Fri Oct 07, 2016 10:09 am
by HpW
DougDbug wrote:It's a computer/programming tradition to start counting at zero. If you are addressing memory there truly is an address zero location in hardware and in an audio file sample zero also exists. i.e. with 4 bits we can count from binary 0000 (decimal zero) to 1111 (decimal 15 or hexadecimal F).
OK, I am a programmer too :D

with your binary example 0000 to 1111 we have a count of 16.

Goldwave from 0...4096, would have a count of 4097, really uses 1...4096 as a count of 4096

or I am wrong :D

Hp

Re: Selection f(samples)

Posted: Fri Oct 07, 2016 3:12 pm
by Moonmist
HpW wrote:
DougDbug wrote:It's a computer/programming tradition to start counting at zero. If you are addressing memory there truly is an address zero location in hardware and in an audio file sample zero also exists. i.e. with 4 bits we can count from binary 0000 (decimal zero) to 1111 (decimal 15 or hexadecimal F).
OK, I am a programmer too :D

with your binary example 0000 to 1111 we have a count of 16.

Goldwave from 0...4096, would have a count of 4097, really uses 1...4096 as a count of 4096

or I am wrong :D

Hp
Hi I know what you mean, and here's why it does that... each sample is like a staircase step... the index (sample) number is the beginning of each step... since the finish marker is placed at the end of the step it gives you one number higher.

Here's a small example, with 4 samples (with "_" being the staircase step of each sample):

0_1_2_3_4

so if you put the finish marker before the fourth sample it would be on "3", but if you selected all 4 samples then the finish marker would now be on "4" so it says "4"! :)

Hopefully this makes sense to you, or you at least understand what the program is doing now! :)