The function is called by the command: (count-samples s (* 2 cycles) This is a function that counts the number of samples for 400 waveform cycles (the waveform crosses zero 2 x 400 = 800 times): (defun count-samples (sig crossings) They are there for the benefit of human readers. (print (/ (* cycles *sound-srate*) sample-count)))Įach line that starts with a semi-colon “ ” is a comment. (setq sample-count (count-samples s (* 2 cycles))) (setf s (extract-abs 1 11 (highpass2 s 20))) (setq cycles 400) about 1 second for a 400 Hz signal (when ( zcount 0) (setq count (1+ count))))) stop when crossed zero twice and return 'count' (do* ((count 0) number of samples between crossing points This is the code that I posted: (defun count-samples (sig crossings) However, your debug output does not match what I get: 481.533 (were you analyzing the default “Chirp” effect?) Those numbers should be the frequencies for each successive 400 cycle period. If the concept falls down then we don’t need to spend time developing efficient code. If the proof of concept works then it should be developed in a more efficient way. It extremely inefficient, but it is simple and it does seem to be pretty accurate. My code was intended only for proof of concept. “Trigger” allows also to return the exact time of the zero crossing, that’s what you’re searched for above.Īnd what part of the code snipplet actually does calculate those values ?Ĭould you please elaborate about t in some detail, I just didn’t get it ?įirst the disclaimer. I have to try myself, what settings are best suited. Furthermore, this gives only the deviations from the carrier frequency, but we actually search for the highest wow or flutter peak (0 to 200 Hz). Since we need a big amount of samples to average the frequency, the precision won’t be very high. If the parameters are wisely chosen, the instant frequency will be returned. Those half-cycles are averaged over “size” samples and we do then advance by “hop” samples. The trigger functions would return 1 0 0 0 1 0 0 0 In order to have also the crossings in the other direction, we turn the sound upside down (multiply by -1) and take the maximum. It takes a modulated signal and creates a new signal by placing the value of “amp” on each transition from minus to plus. We gather all 44100 samples at a sample rate of 20 Hertz (trigger snd zero)) size hop op-average))) (let* ((zero (snd-from-array 0 (snd-srate snd) (vector amp)))) determines the sample rate of the result Size = amount of samples that are averaged If there is a deviation in speed this would / should show up as a DC part in the output file and is actually welcome, as it allows to go down in spectral analysis very very low.Īs it is, the code uses only a test sound, namely a frequency sweep from 440 to 880 Hz. So, the FM decoded signal shown above was from a software tool that - I guess - works like I would like to “translate” zero crossings into amplitude values.ġ.) calculate the difference of any zero-zero time with respect to a given carrier (say 3000 / 3150 Hz)Ģ) assign this differnce as an amplitude value in the output file Might be, it will be of some interest to mimic different W&F test setups later on, but frankly thats not high on my list right now. My general aim is not to mimic any wow and flutter measurement standards (there are quite a lot of them, depending on country and the philosophy those guys there were following) but to have a analysis method at hand that allows for deep spectral insight at first hand. The file I uploaded was form a cassette deck where a 3150Hz Tone was recorded.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |