T=1/f
dt=1/fs
Num samples per period:
nspp = T / dt = fs/f
E.g.
f=440 Hz, fs=44100 Hz,
then:
nspp ~= 100.
Probably need to linearly interpolate these 100 samples (for instance) up to a bigger number of samples (f < 440 Hz) or down to a smaller number of samples (f > 440 Hz) to make it nearly frequency independent and make it easy enough to use.
Then use some data format to describe this waveform shape. E.g.
|
|# #
|## ##
|#### ####
|####### #######
|####################
+--------------------
T=1/f
dt=1/fs
Num samples per period:
nspp = T / dt = fs/f
E.g.
f=440 Hz, fs=44100 Hz,
then:
nspp ~= 100.
Probably need to linearly interpolate these 100 samples (for instance) up to a bigger number of samples (f < 440 Hz) or down to a smaller number of samples (f > 440 Hz) to make it nearly frequency independent and make it easy enough to use.
Then use some data format to describe this waveform shape. E.g.
|
|# #
|## ##
|#### ####
|####### #######
|####################
+--------------------