diff --git a/applications/lofar2/model/pfb_os/dsp_study_erko.txt b/applications/lofar2/model/pfb_os/dsp_study_erko.txt index d6141fb1fb13c8226f142c5752a2a84658a45499..34b5b1f82b347aa6fbab38f76bf31e08df4cf6e5 100644 --- a/applications/lofar2/model/pfb_os/dsp_study_erko.txt +++ b/applications/lofar2/model/pfb_os/dsp_study_erko.txt @@ -1004,7 +1004,8 @@ c) s-plane and z-plane 12) Multirate processing: - Linear Time Variant (LTV) process, because it depends on when the - downsampling and upsampling start. + downsampling and upsampling start. This causes that order of operations + matters [LYONS 10.3.1] - Sampling and sampling rate conversion can be viewed as a modulation process in which the spectrum of the digital signal contains periodic repetitions of the baseband signal (images) spaced at harmonics of the sampling frequency. @@ -1013,36 +1014,66 @@ c) s-plane and z-plane baseband [CROCHIERE 2.4.2]. - Polyphase filtering ensures that only the values that remain are calculated, so there are D or U phases [LYONS 10.7]. The LPF with all phases is called - the prototype filter. + the prototype filter. Do not calculate samples that will be: + . discarded, + . inserted as zeros. - For large D or U use two stage D = D1 * D2 or U = U1 * U2, where D1 > D2 and U1 < U2 [LYONS 10.8.2] -- Polyphase decomposition of H(z) [VAIDYANATHAN 4.3]: - - H(z) = H0(z^N) + H1(z^N) z^-1 + H2(z^N) z^-2 + ... + Hi(z^N) z^-i - - . Hi(z^N ) is the z-transform of h(mN + i) - . Phase i of h(n) with N - 1 zeros - -- Noble identities [LYONS Fig 10.20], [VAIDYANATHAN Fig 4.2.3] - - . Up sampling : x[n] --> up Q --> H(z^Q) --> y[m], is equivalent to: - H(z) --> up Q - - . Down sampling : x[n] --> H(z^Q) --> down Q --> y[m], is equivalent to: - x[n] --> down Q --> H(z) --> y[m] - - . H_i(z^Q) is upsampled-by-Q version of H(z), so with Q-1 zero coefficients - in the H(z) power series, starting at phase i. - -- LPF + downsampling = decimation [LYONS 10.9, PROAKIS 10, CROCHIERE Fig 3.2, - VAIDYANATHAN Fig 4.1.4, SP4COMM 11.1.2]: - . Downsampling: +- Sampling, downsampling and upsampling + . Sampling causes the analoge spectrum to alias around k 2pi, similar for + downsamping the the digital spectrum aliases around k 2pi / D, as if the + analogue signal was sampled directly at the downsampled rate [LYONS 10.1]. + . Downsampled spectrum [LYONS 10.3.2] + 1. Draw original spectrum beyond -2pi to + 2pi, to show 0 and at least one + spectral replication (alias) for both negative (-2pi) and positive + (+2pi) frequency directions of the original sample frequency fs_old = + 2pi. + 2. Draw D - 1 copies of the original spectrum shifted by k 2pi / D, note + k = 0 is the original spectrum of step 1 + 3. Scale up the frequency axis of the new spectrum by factor D to get the + frequency axis for the down sample frequency. The downsampled spectrum + now ranges from -pi to pi for fs_new = 2pi. + 4. Scale down magnitude of new spectrum by factor D. The time domain + amplitude of downsampled signal remains the same, but the frequency + domain magnitude decreases by factor D, because the DFT magnitude is + proportional to number of time-domain samples used in the + transformation [LYONS 10.3.1]. + . Upsampled spectrum [LYONS 10.5.2] + 1. Draw original spectrum beyond -U 2pi to +U 2pi, to show at least U + spectral replications of the original spectrum in both negative and + positive frequency directions of the original sample frequency fs_old = + 2pi. That is all, because inserting U - 1 zeros merely increases the + effective sample frequency to fs_new = U fs_old. It does not change the + spectrum, but it does cause that U - 1 spectral replications (aliases) + are now also in the 2pi range of fs_new. Hence it looks like inserting + zeros replicates the spectrum around multiples of 2pi / U, but it is + easier to understand as that increasing fs_new now includes U - 1 + replications of the original spectrum. + 2. Scale down the frequency axis of the new spectrum by factor U to get the + frequency axis for the up sample frequency. The upsampled spectrum now + ranges from -pi to pi for fs_new = 2pi. + 3. The magnitude of new spectrum remains the same. + . Decimation = LPF + Downsampling [LYONS 10.1]: + To avoid overlapping aliasing after downsampling to fs_new an LPF needs + to band limit the original spectrum to pi / D = fs_old/2 / D. + . Interpolation = Upsampling + LPF: + To interpolate the zero values for fs_new an LPF needs to band limit the + new spectrum to pi / U = fs_new/2 / D. + Using zero order hold would be a naive approach, because then all samples + need to be calculated and the LPF then needs to compensate for the + non-flat pass band of sin(x)/x [LYONS 10.5.1]. + . Decimation and interpolation can also use a BPF to select another part of + the band [HARRIS 2.2, VAIDYANATHAN 4.1.1]. + +- Downsampling [LYONS 10.1, PROAKIS 10, CROCHIERE Fig 3.2, VAIDYANATHAN Fig + 4.1.4, JOS4 11.1, SP4COMM 11.1.2]: x_D[n] = x[nD], because x_D removes D-1 values from x Define x' at x time grid, but with x' = 0 for samples in x that will be - discarded: + discarded. This operation has no name in literature, probably because it + is a conceptual step and not an implementation operation: x'[n] = d[n] x[n], with d[n] = 1, for n % D = 0 = 0, otherwise @@ -1087,25 +1118,20 @@ c) s-plane and z-plane X_D(z) on the unit circle with z = exp(jw) [PROAKIS Eq 10.2.9]: D-1 - X_D(e^jw) = 1/D sum X(exp(j (w - k 2pi) / D)) + X_D(e^jw) = 1/D sum X(exp(j (w / D - k 2pi / D))) k=0 + w in [0:2pi> + summation terms for k != 0 are aliasing terms + The resulting spectrum is the scaled sum of D superimposed copies of the original spectrum X(e^jω), and each copy is shifted in frequency by a multiple of 2pi/D and the result is stretched by a factor of D. This is similar to sampling of an analogue signal that creates a periodization of the analogue spectrum, but now the spectra are already inherently 2pi periodic, and downsampling creates D − 1 additional interleaved copies. - For the spectral copies not to overlap, the maximum (positive) frequency - the original spectrum must be less than pi / D. This is the non-aliasing - condition for the downsampling operator. - . Discarding samples copies the spectrum around multiples of 2pi / D. First - the LPF has to remove all copies. - . Do not calculate samples that will be thrown away. - -- Upsampling + LPF = interpolation: - . Upsampling: +- Upsampling: x_U[n] = x[n / U], for n % U = 0 = 0, otherwise, because x_U inserts U-1 zeros in x @@ -1116,15 +1142,26 @@ c) s-plane and z-plane . Spectrum, evaluate X_U(z) on unit circle [PROAKIS Eq 10.3.3]: - X_U(e^jw) = X(exp(jw U)) + X_U(e^jw) = X(exp(jw U)), w in [0:2pi> + X(jwL) traverses unit circle U times + +- Polyphase decomposition of H(z) [VAIDYANATHAN 4.3]: - . Inserting zeros replicates the spectrum around multiples of 2pi / U. Then - the LPF has to remove all replicas and by that it interpolates to fill in - the zeros. To remove the replicas, the LPF pass band is pi / L. - . Do not calculate samples that will be inserted as zeros. - . Using zero order hold would be a naive approach, because then all samples - need to be calculated and the LPF then needs to compensate for the non-flat - pass band of sin(x)/x [LYONS 10.5.1] + H(z) = H0(z^N) + H1(z^N) z^-1 + H2(z^N) z^-2 + ... + Hi(z^N) z^-i + + . Hi(z^N ) is the z-transform of h(mN + i) + . Phase i of h(n) with N - 1 zeros + +- Noble identities [LYONS Fig 10.20], HARRIS 2.2.1, VAIDYANATHAN Fig 4.2.3] + + . Down sampling : x[n] --> H(z^Q) --> Q:1 --> y[m], is equivalent to: + x[n] --> Q:1 --> H(z) --> y[m] + + . Up sampling : x[n] --> 1:Q --> H(z^Q) --> y[m], is equivalent to: + H(z) --> 1:Q + + . H_i(z^Q) is upsampled-by-Q version of H(z), so with Q-1 zero coefficients + in the H(z) power series, starting at phase i. - Fractional time delay [CROCHIERE 6.3] . Up sampling Q --> LPF --> z^(-d) --> down sampling Q yields semi allpass