How to get volume of simple sine , which is high frequency like sample_rate/2 and it’s extremum (pik) not in sample frame
but if it plaing - volume is as low fq sine and more then pcm max point in wave file
how to get pik volume of array of frames?
In any programing language (i.e. PHP)
I can’t finde in google how pcm transforms to harmonic wave
You questions are confusing…
You can find the positive & negative peaks (for the whole file or for a period of time) or you can calculate the RMS, etc.
The Nyquist theory says the signal has to be LESS than the sample rate. (Exactly half may be invalid.) If you digitally generate a sine wave at exactly half the sample rate, all the sines are zero and you’ll get a flat line. If you generate a cosine wave the cosines alternate between +1 and -1 and it works perfectly!
If you are recording analog the exact angle where it’s sampled is unknown. But there is (or should be) a low-pass anti-aliasing filter that kicks-in before the Nyquist limit so a signal at the sample rate never gets to the analog-to-digital converter.
It is “imperfect” since it’s quantized in the X (time) and Y (amplitude) dimensions (and other real world limitations). It’s generally better than human hearing but you can get “interesting” results very-near the Nyquist limit. For example, try generating a 3999Hz tone at a sample rate of 8000Hz.
Sorry, what?
Harmonic?
A low-pass filter at the DAC output “smooths” the voltage and it can make a nice sine wave.
But once, I was doing an experiment with an oscilloscope and a soundcard and I was shocked to see a stair-stepped wave with no filtering (on this particular soundcard). I had never noticed anything wrong with the sound. But then I realized that all of the harmonics are ultrasonic (at 44.1kHz), plus the amplifier might filter-out ultrasonics, and the speakers will mechanically filter.
I’m asking about the theory and mathematical model, where I can read about the decomposition of a harmonic pcm signal into Fourier series (not to be confused with fft), preferably using an example of program code.
Look at the picture in the attachment. Adobe Audition itself interpalates a complete sine at 2 points, and Audicity shows a broken curve. Any program that shows the volume of a pcm signal shows the same volume as at lower frequencies where you can find the peak of the sine as well as at high frequencies where there are only 2 points for constructing the sine. This means that by 2 points you can understand what the amplitude is…
I’m not interested in the actual design of the digital-to-analog converter yet…
I am writing an online (uploading a recorded file to a server) program for measuring a sound card and I want to measure the amplitude-frequency response without using fft. So far at high frequencies I have found a soxr interpolation option of 10 times at a clock frequency of 1920000, you can find a peak at a frequency of 30 kHz, do not take into account noise (average over several peaks)
There is RMAA.
Normally, you use a frequency sweep, or one frequency at a time so you don’t need FFT. And then normally you just find the greatest positive or negative sample value. If the tone is long-enough there will eventually be a sample at (or very-near) the sine peak of or +90 and -90 degrees and you can find the peak of a sine wave.
Alternatively, you can just find the RMS (or the average of the absolute values). But if you are near the Nyquist limit, the RMS will be lower than the original analog (because you are not “catching” all of the peaks).
There are also algorithms for calculating the “true peak” which doesn’t exist in the actual digital data but can exist in the reconstructed continuous analog signal. But, I believe the actual analog signal depends on the DAC so there’s no foolproof way of calculating it.
…The Nyquist sampling theory actually requires an infinitely-long continuous signal, and then it can be perfectly reconstructed from the digital samples. Real world audio isn’t like that (although we can generate constant-continuous tones) and DACs aren’t that “smart” and they work “instantly” without analyzing the long-term signal (which wouldn’t be useful for audio program material anyway).
I think what you are looking for is “sinc interpolation”. However, a simpler approach is oversampling.
RMAA - terribly lies
I’m tested it by virtual cable + apo Eq + voxengo tube amp (vst distortion) and compare it with REW
rev THD+n - 0.20%
My bit by bit compare THD+n - 0.1889%
rmaa THD+n - 0.06489%
Adobe audition measures the true peak - jast generate sweep tone and play it and volume meter not changed, Foobar too, Audacity too
If it’s known frequency and delta phi of sine you can get amplitude (A) -
A*sin(phi)=curent_sample volume/max volume
phi - some delta if sine starts not from zero point of sample rate starts + sample/smple_rate*2*Pi*w (seconds)
w=1/frequency
Energy of sine =A/sqrt(2) no matter the frequency
RMS = Energy of sine = sqrt (sum_each_sample^2/N)
N - quantity of samples
A=sqrt(sum_each_sample^2/N*2)
for any frequency sine wave
Here best way calculus - Describe a sine wave of known frequency with only two points - Mathematics Stack Exchange
where
Y - volume of sine wave
ω - frequency i.e. 20000 Hz
t2−t1 - time between 2 samples y1 and y2 i.e. if it’s nearest samples with 192000 samplerate t2-t1=1/192000 sec.
y1 , y2 value of two samples
This topic was automatically closed after 30 days. New replies are no longer allowed.