DSPRelated.com
Forums

Correcting for DAC and analog filters

Started by Peter Mairhofer November 18, 2015
Hi,

I want to identify a DT equivalent system of a transmitter. It should
include the Zero-Order-Hold DAC, interpolation filter (and possibly
mixer + any image rejection filters etc).

I created a simple SIMULINK model which implements a 4x
interpolation-DAC with the following specs: fs=200 MHz (i.e.,
fs_DACOUT=800Mhz), Butterworth reconstruction filter (fcut=100Mhz).

Then I send BLWGN through the system to identify an equivalent FIR
filter. The performance is then tested using an 80 MHz test signal.
However, although the image rejection should be more than 78dB, I cannot
get beyone -40dB to -49dB NMSE. Even worse, this only (!) works for a
4th order Butterworth filter. Either reducing it or increasing it lets
the NMSE drop to -25dB or lower. Furthermore, just adding another analog
filter (with fcut > 100 MHz, e.g. as harmonic image rejection for a
mixer) has the same effect. This makes no sense!

Do I miss something?

Below are some figures and the code for reference.


Thanks!
Peter






The digital interpolation filter is:
   http://snag.gy/11ORR.jpg
This means that for an 80MHz signal the image will be rejected by 78 dB
(and the 4x images are reasonably rejected by the analog reconstruction
filter)

Following the frequency response of the identified system and test
result (80MHz test signal) for 4th-order Butterworth:

   http://snag.gy/l8YlG.jpg
   http://snag.gy/Bet9B.jpg (-49.71dB NMSE)

While changing to a lower order would at least explain worse results
(less image rejection - although 3rd order should still be enough!), a
5th order would not. This shows the same plots for 5th order Butterworth:

   http://snag.gy/R7Nlq.jpg
   http://snag.gy/YnWti.jpg (-26.71dB NMSE!!!)

Here is a self-contained ZIP with the (simple!) MATLAB code, Simulink
and used data files:
https://www.dropbox.com/s/jxikl2tsogmqcc0/txchar.zip?dl=0

One thought is it could lie on the fact that I use the full spectrum
(100MHz) for identification. Since aliasing occurs between 80Mhz-100Mhz,
this could give wrong results. However, why would this matter for the
frequency response up to 80MHz? Even if, for identification I need to
use BLWGN (up to 100MHz), otherwise I get a badly conditioned matrix
(persistent excitation of all modes).

In order to get as close as possible to ideal sampling, I sample with
simfactor=10 above fs_DACOUT=800Mhz and just null out the spectrum (but
no significant changed without doing this - all images should be
reasonably well rejected anyway).

The most important fragments of the code are also here:

% system parameters
fs = 200e6;
Ts = 1/fs;
BW = 80e6;
simfactor = 10;

% 4x-interpolation DAC + reconstruction filter
load h_dac_intpolflt;
n_intpol = 4;
n_ord_rec = 4;
fs_fmax = 2*n_intpol;
[A,B,C,D] = butter(n_ord_rec,(n_intpol*fs)/fs_fmax*2*pi,'s');

%% identify system
load xn_train;
Tend = N*Ts;
xn_dac = [ (0:Ts/n_intpol:xn(end,1)+Ts-Ts/n_intpol)' ,
resample(xn(:,2),n_intpol,1,h_dac_intpolflt) ];
sim tx;

Z = fft(simout.signals.values(2:end));
Z(n_intpol*N/2:length(simout.signals.values)-n_intpol*N/2+1) = 0;
z = downsample(ifft(Z),n_intpol*simfactor)*2;

h_tx_est = solveFIR(xn(:,2), z, 100);

figure, freqz(h_tx_est);

%% test the system

load xn_test;
xn_dac = [ (0:Ts/n_intpol:xn(end,1)+Ts-Ts/n_intpol)' ,
resample(xn(:,2),n_intpol,1,h_dac_intpolflt) ];
sim tx;
Z = fft(simout.signals.values(2:end));
Z(n_intpol*N/2:length(simout.signals.values)-n_intpol*N/2+1) = 0;
z = downsample(ifft(Z),n_intpol*simfactor)*2;

z0 = filter(h_tx_est(1:60), 1, xn(:,2));

NMSE = 20*log10(norm(z(10:end) - z0(10:end))/norm(z(10:end)))




Really ... nobody?

It just makes no sense!

Since I'm really only having a signal up to 80MHz there is just no
aliasing and my setup is identical to chapter 4.5 from
Oppenheim/Schafer, 2nd Ed.

The one and only explanation I have (which would still not explain the
whole story) is aliasing that occurs while identification.

But wouldn't the error just affect the frequencies where aliasing occurs?

I tried building the transfer function analytically & using the Parks
McClellan algorithm: no luck. Tried probing the frequencies manually
with cosines: Same result.



On 2015-11-17 20:12, Peter Mairhofer wrote:
> Hi, > > I want to identify a DT equivalent system of a transmitter. It should > include the Zero-Order-Hold DAC, interpolation filter (and possibly > mixer + any image rejection filters etc). > > I created a simple SIMULINK model which implements a 4x > interpolation-DAC with the following specs: fs=200 MHz (i.e., > fs_DACOUT=800Mhz), Butterworth reconstruction filter (fcut=100Mhz). > > Then I send BLWGN through the system to identify an equivalent FIR > filter. The performance is then tested using an 80 MHz test signal. > However, although the image rejection should be more than 78dB, I cannot > get beyone -40dB to -49dB NMSE. Even worse, this only (!) works for a > 4th order Butterworth filter. Either reducing it or increasing it lets > the NMSE drop to -25dB or lower. Furthermore, just adding another analog > filter (with fcut > 100 MHz, e.g. as harmonic image rejection for a > mixer) has the same effect. This makes no sense! > > Do I miss something? > > Below are some figures and the code for reference. > > > Thanks! > Peter > > > > > > > The digital interpolation filter is: > http://snag.gy/11ORR.jpg > This means that for an 80MHz signal the image will be rejected by 78 dB > (and the 4x images are reasonably rejected by the analog reconstruction > filter) > > Following the frequency response of the identified system and test > result (80MHz test signal) for 4th-order Butterworth: > > http://snag.gy/l8YlG.jpg > http://snag.gy/Bet9B.jpg (-49.71dB NMSE) > > While changing to a lower order would at least explain worse results > (less image rejection - although 3rd order should still be enough!), a > 5th order would not. This shows the same plots for 5th order Butterworth: > > http://snag.gy/R7Nlq.jpg > http://snag.gy/YnWti.jpg (-26.71dB NMSE!!!) > > Here is a self-contained ZIP with the (simple!) MATLAB code, Simulink > and used data files: > https://www.dropbox.com/s/jxikl2tsogmqcc0/txchar.zip?dl=0 > > One thought is it could lie on the fact that I use the full spectrum > (100MHz) for identification. Since aliasing occurs between 80Mhz-100Mhz, > this could give wrong results. However, why would this matter for the > frequency response up to 80MHz? Even if, for identification I need to > use BLWGN (up to 100MHz), otherwise I get a badly conditioned matrix > (persistent excitation of all modes). > > In order to get as close as possible to ideal sampling, I sample with > simfactor=10 above fs_DACOUT=800Mhz and just null out the spectrum (but > no significant changed without doing this - all images should be > reasonably well rejected anyway). > > The most important fragments of the code are also here: > > % system parameters > fs = 200e6; > Ts = 1/fs; > BW = 80e6; > simfactor = 10; > > % 4x-interpolation DAC + reconstruction filter > load h_dac_intpolflt; > n_intpol = 4; > n_ord_rec = 4; > fs_fmax = 2*n_intpol; > [A,B,C,D] = butter(n_ord_rec,(n_intpol*fs)/fs_fmax*2*pi,'s'); > > %% identify system > load xn_train; > Tend = N*Ts; > xn_dac = [ (0:Ts/n_intpol:xn(end,1)+Ts-Ts/n_intpol)' , > resample(xn(:,2),n_intpol,1,h_dac_intpolflt) ]; > sim tx; > > Z = fft(simout.signals.values(2:end)); > Z(n_intpol*N/2:length(simout.signals.values)-n_intpol*N/2+1) = 0; > z = downsample(ifft(Z),n_intpol*simfactor)*2; > > h_tx_est = solveFIR(xn(:,2), z, 100); > > figure, freqz(h_tx_est); > > %% test the system > > load xn_test; > xn_dac = [ (0:Ts/n_intpol:xn(end,1)+Ts-Ts/n_intpol)' , > resample(xn(:,2),n_intpol,1,h_dac_intpolflt) ]; > sim tx; > Z = fft(simout.signals.values(2:end)); > Z(n_intpol*N/2:length(simout.signals.values)-n_intpol*N/2+1) = 0; > z = downsample(ifft(Z),n_intpol*simfactor)*2; > > z0 = filter(h_tx_est(1:60), 1, xn(:,2)); > > NMSE = 20*log10(norm(z(10:end) - z0(10:end))/norm(z(10:end))) > > > >