Dear Stefan, 
Dear aRtsians,
 
As a first thing, let me  intoduce myself.
My name is Frank "#bang" Haferkorn. The nickname "#bang" stand for 
"hashbang". Those who program bash-skripts now what its about. I am a 
physicist with a specialization to acoustics/signaltheory.
So think I I well hosted at the arts-project
 
 
I discussed the following problem with Stefan for a while. 
 
At the current kde release 2.1.1 all ofthe Synth_WAVE_*  modules calculate 
their values by evaluating the phase information (pos) and calculating using 
a mostly simple algorithm to determin the wanted amplitude.
 
For example is the rule for calcuilating a saw wave:
 saw = 2*(pos-0.5)
This is an algorithm for an ideal saw-wave.
 
As the spectra is limited by half the sample frequency, this will fail and 
resume in lower frequencies mirrowed into the resulting signal.
 
HINT: Try to genarate 1,5kHz , 8kHz and a 15kHz Sinus Waves. Analyse the 
signal with big scaling factor, in order to analyse groups of periods . The  
smaller frequency look good, but the nearer the frequency gets to half the 
sample frequency (here 22,1kHz). You see ramps of the Envelopes of the 
Saw-Wave-Signal.
These Ramps in the Envelope-Wave give the distorting noise (as of mirror 
frequencies)
 
 
Stefan tried to clear this with creating new a Modules under Synth_Osc_Saw 
etc.
let's hear a translation of his own words.
 
In My Optinon is the problem easy. If you "sample" a real ramp, then it isn't 
 limited in the frequency domain. That's the reason of the aliasing.
I recently have tried to implement a band-limited ramp (saw-wave)
Herein we can't use de aRrts typical diffrence betwen the Modul that creates 
the waveform and a generic function generator.as the Waveform changes with 
the frequency. So the new modul shall get the name Synth_OSC_SAW. It is the 
synth_FREQUENCY and a Synth_WAVE_SAW a single module
 
Stefans solution works like this.
 
 generating an ideal ramp in frequency domain with an explicit formula in 
order to gerate the FFT Koefficients with an ideal ramp.
remove the frequencies over the Bandwidth over F_grenz = SR/2with a  Blackman 
Window
 inverse transformation into the time domnain (IFFT)
 the resulting Wavetable is the sampled band-limited ramp (saw-wave) with 
SR/2, so that the Wavetablesynthesis (here without every Interpolation) is 
satisfying
 
Problems with the implementation:
IFFT is not performant, so changing the frequency is cpu-costy
at the moment only realized for saw-wave
frequency-sliding and modulating won't work as of block-calculation
But that might be the way we have about to go in order to get rid of the 
aliasing
It is also possible, to implement it with (FIR/IIR-filter or earlier 
calculated band-limited tables instead of IFFT. This has to be implemented 
into other waveforms except sinus
 
 
 
 
My solution  is different. but has the same effects at fewer cpu-costs
 
It should be necessary to implementa new module property:
 
The new module Functionality OVERSAMPLING has to come with:
Module wide Oversampling (=increasing of the samplerate)
this leads to a module wide increasing of samplerate at runtime
needs interpolation ofall nonconstant inputs and downsampling of all outputs 
by any factor x^2
 
A module with oversampling-factor different 1 performs a RUNTIME:
oversampling/interpolating the  increased samplerate from all non constant 
input-channels
downsampling/bandwidth-filter and sampleratereduction for all output chanells
performing the sample stepping increased (by the oversampling factor)
 
TODO, if accepted.
If the above precedere is accepted, Stefan could do a simple Oversampling 
module with copying  the last samples (=hold) instead of interpolating. amd 
integration (=averaging) for downsampling. (Sorry,Idon't know thearts 
intrinsics right now.)
I will then implement the proper over/downsampling, I mentioned similar 
software earlier to Stefan.
 
That are the resultsto the arts projects
New Oversampling, also useful for ather time critical  feedback operations
Move all Synth_WAVE... to the new Synth_CALC... . in sourcecode.
Redo the Synth_WAVE as module-files with oversampling using the now called  
Synth_CALC modules.
 

Reply via email to