I also asked about it here on the Sound Design forum, but the question is, is it hard computer science / math, so it might belong on this forum:
Thus, I can successfully find all the information about the WAV file, except for the amplitude and frequency (hertz) of the big sin function, reading the binary files in the file (which, unfortunately, are exactly what I'm looking for). To check what I'm saying, a file generates a single wave only using the equation:
F (s) = A * sin (T * s)
Where s is the current sample, A is the amplitude, and T is the period. Now the equation for T (period):
T = (2π * Hz) / (α * ω)
Where Hz is the frequency in hertz, α is the samples per second, and ω is the number of channels.
Now I know that for the solution for the amplitude, I could just find the value of F (s), where
s = (π / 2) / T
Because then the value of the sine wave will be equal to 1, and the final value will be equivalent to A. The task is to divide by T, I must know Hertz (or Hz).
Is there a way that I can read the WAV file to find the Hertz from the data, assuming the file contains only one wave.
source
share