ono to neni tak jednoduche jak si myslis:))) a ty matematicke souteze jsme vyhraval celostatni:)
pokud se to zrychli ze 440 na 442 ty to k tomu nahrajes dochazi k tomuhle:
Insert 159 zeros between every input sample. This raises the data rate to 7.056 MHz, the least common multiple of 44.1 and 48 kHz. Since this operation is equivalent to reconstructing with Dirac delta functions, it also creates images of frequency f at 44.1−f, 44.1+f, 88.2−f, 88.2+f, ...
Remove the images with a digital filter, leaving a signal containing only 0–20 kHz information, but still sampled at a rate of 7.056 MHz.
Discard 146 of every 147 output samples. It does not hurt to do so since the signal now has no significant content above 24 kHz.
(In practice, of course, there is no reason to compute the values of the samples that will be discarded, and for the samples you still need to compute, you can take advantage of the fact that most of the inputs are 0. This is called polyphase decomposition, and drastically reduces the computation effort, without affecting the conversion quality.)
This process requires a digital filter (almost always an FIR filter since these can be designed to have no phase distortion) that is flat to 20 kHz, and down at least x dB at 24 kHz. How big does x need to be? A first impression might be about 100 dB, since the maximum signal size is roughly ±32767, and the input quantization ±1/2, so the input had a signal to broadband noise ratio of 98 dB at most. However, the noise in the stopband (20 kHz to 3.5 MHz) is all folded into the passband by the decimation in the third step, so another 22 dB (that's a ratio of 160:1 expressed in dB) of stopband rejection is required to account for the noise folding. Thus 120 dB rejection yields a broadband noise roughly equal to the original quantizing noise.
There is no requirement that the resampling in the ratio 160:147 all be done in one step. Using the same example, we could re-sample the original at a ratio of 10:7, then 8:7, then 2:3 (or do these in any order that does not reduce the sample rate below the initial or final rates, or use any other factorization of the ratios). There may be various technical reasons for using a single step or multi-step process — typically the single step process involves less total computation but requires more coefficient storage.
lidsky receno nesedi:)
a time stretch tam neni to neobhajis:)))
Naposledy upravil(a) carloff
dne 04 čer 2011 00:54, celkem upraveno 1 x.