Hello All,
Here's the story... I have a Morse Code program on a 28X2 that turns out random letters in groups of 5 for practice. But what my fellow radio compadres and I have noticed is there is a small issue with something like....
Random w4
b10 = w4 // 26 + 1 ' (random numbers 1-26 are EEprom locations, the actual encoded letter are in each location)
This works fine but the frequency of letters appear evenly. And this is not the case as we all know with spoken English. After reading a bit on the net, the letter E appears approximately 130 out of 1000 letters spoken. And Z only 1 in a 1000. So, not making it past high school algebra some 30 plus years ago, I've take the approach of rolling 2 dice. One with 1 - 13 sides and one with 1 - 14 sides. This should produce some sort of probability(?) or distribution(?) between 2 and 27. This will point to EEprom locations 2 - 27 where the encoded letter resides. Letters like E and T will be in locations 13 and 14 and letters like Z and X will be in locations 2 and 27 with the rest of the locations filled in with letters based on their frequencies.
But I don't think this is the actual distribution of letters. Possibly close(?a big guess?) but not exact.
So, I guess my questions is.... is there some other way to achieve the proper distribution of letters since it is not "linear" like rolls of the dice if that is the right way to describe the distribution of dice if graphed out on paper?
The only other thing I could think of, if there were 1000 available spare memory locations, I could fill memory location 1 with the encoded letter Z, locations 435 to 565 with the encoded letter E (130 locations) and location 1000 with the letter X and then fill in the rest of the memory locations with the appropriate number of letters like T = 92 locations, H = 34 locations, M = 25 locations, b = 10 locations etc. etc. and then use the Random W4 thing from above but b10 = w4 // 1000 + 1
Or maybe the dice approach again to randomly point to the 1000 different memory addresses and produce the exact distribution of Morse Code practice letters??? I just can't get my head around this.
Your thoughts and comments are most appreciated.
(I actually like a even distribution of letters as it give (me) more practice on letters which rarely appear like Z and X. But some of my fellow radio brethren hate it. So I thought I would include both in my PICAXE project)
Thanks,
HamRadioAddict
Here's the story... I have a Morse Code program on a 28X2 that turns out random letters in groups of 5 for practice. But what my fellow radio compadres and I have noticed is there is a small issue with something like....
Random w4
b10 = w4 // 26 + 1 ' (random numbers 1-26 are EEprom locations, the actual encoded letter are in each location)
This works fine but the frequency of letters appear evenly. And this is not the case as we all know with spoken English. After reading a bit on the net, the letter E appears approximately 130 out of 1000 letters spoken. And Z only 1 in a 1000. So, not making it past high school algebra some 30 plus years ago, I've take the approach of rolling 2 dice. One with 1 - 13 sides and one with 1 - 14 sides. This should produce some sort of probability(?) or distribution(?) between 2 and 27. This will point to EEprom locations 2 - 27 where the encoded letter resides. Letters like E and T will be in locations 13 and 14 and letters like Z and X will be in locations 2 and 27 with the rest of the locations filled in with letters based on their frequencies.
But I don't think this is the actual distribution of letters. Possibly close(?a big guess?) but not exact.
So, I guess my questions is.... is there some other way to achieve the proper distribution of letters since it is not "linear" like rolls of the dice if that is the right way to describe the distribution of dice if graphed out on paper?
The only other thing I could think of, if there were 1000 available spare memory locations, I could fill memory location 1 with the encoded letter Z, locations 435 to 565 with the encoded letter E (130 locations) and location 1000 with the letter X and then fill in the rest of the memory locations with the appropriate number of letters like T = 92 locations, H = 34 locations, M = 25 locations, b = 10 locations etc. etc. and then use the Random W4 thing from above but b10 = w4 // 1000 + 1
Or maybe the dice approach again to randomly point to the 1000 different memory addresses and produce the exact distribution of Morse Code practice letters??? I just can't get my head around this.
Your thoughts and comments are most appreciated.
(I actually like a even distribution of letters as it give (me) more practice on letters which rarely appear like Z and X. But some of my fellow radio brethren hate it. So I thought I would include both in my PICAXE project)
Thanks,
HamRadioAddict