![]() |
![]() ![]() ![]() ![]() ![]()
|
next newest topic | next oldest topic |
Author | Topic: Please help : Trying to detect zero crossings | |
tuscland Member |
![]() ![]() ![]()
I am trying to make a sound that detects zero-crossings and play back the detected one-period waves. Right now, this sound does actually nothing : the input must be the same as the output. The problem here is that I must record and play back the wavetable very precisely, which involves triggers at sample rate, not at control rate. I have a sound here which works almost as I would want, but there is a glitch I can't solve : when the test oscillator (which may be replaced later with a sample or live input) goes higher in frequency strange artefacts are induced, and I can't figure out why. Is there a guru that can help me and try to see what is wrong with my Sound? Best Regards, PS: regarding my previous post, I solved the problem of the SetableRamp with a Up/Down Counter ... IP: Logged | |
tuscland Member |
![]() ![]() ![]() I found the solution! A OneSampleDelay was needed between the prototype named 'Index Ramp' and 'Playback'. The value -1 in FirstStepOffSet was not needed, 0 was OK. I guess I needed the night to think about this ... I am still learning to be wise.
[This message has been edited by tuscland (edited 12 April 2006).] IP: Logged | |
pete Member |
![]() ![]() ![]()
You beat me to it. BUT This is only masking the problem. I believe you intend to swap cycles around and join them together in different orders which will bring the problem straight back again. This is because, although you are slicing the cycles on the zero crossing point it is really only being sliced to the nearest whole sample. Hence cycle lengths that may really be 10.25 samples long, fall on the nearest border. Thats why we get 10 10 10 11 and not 10.25 10.25 10.25 10.25. A bit like the extra day in a leap year. So how do you over come this. One way would be to measure the the values of the sample immediately before and after the zero crossing and estimate where in the sample the zero actually happened. This would require a bit of maths including a division. There is a SR rate division module in petes DSP but it is pro hunger. Then you would have to play back cycles shifted by that fraction of a sample by using interpolation of adjacent samples. Another method would be Option Three, which is to recored more than just one cycle (in this case two) and then overlap them using two readers and writers each working on every other cycle. Then you cross-fade between them on play back. This will get rid of the click but it won't solve the problem that different cycles will be in very slightly different phases and durations. This will be less of a problem at lower frequencies but there will still be a sort of FM especially at higher frequencies. It may not be such a problem when the cycles used are not sine waves as the lack of harmonics allow any artifacts to be easily heard. Hope this helps Pete IP: Logged | |
tuscland Member |
![]() ![]() ![]() Pete, thank you very much for your insight. I will try to enhance the algorithm, taking in account the problem of inter-sample crossing, which I have not thought about beforehand. I will get a look at your file, as soon as I have a hand on my Capy.
IP: Logged |
All times are CT (US) | next newest topic | next oldest topic |
![]() ![]() |
This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.