Forum Discussion
Altera_Forum
Honored Contributor
13 years ago --- Quote Start --- I & FvM checked that already. There was typing error in your first doc which I corrected as -i+1 addition then FvM told us that Hogenauer's equation was mistyped as 2N-1 instead of 2N - i which is equivalent to what I did. Anyway I corrected te matlab code - see my last version and it does agree with your figures. So I am more inclined to think you are doing something wrong rather than Hogenauer or Donadio or FvM are wrong. Can you post your matlab code so we get the culprit. --- Quote End --- here is the matlab code that you wanted to see Bin = 24; %input width N = 9; %stages of comb or integrator M = 1; %differential delay R = 8; %interpolation rate %cic decimator at any stage Bout = N * log2(R*M) + Bin; %cic interpolator per ith stage %stages 1~N for i = 1:N G = 2^i; Bout = Bin + log2(G); d(i) = Bout; end %N+1 ~ 2N stages for i = N+1:N*2 G = 2^(2*N-1)*(R*M)^(i-N)/R; Bout = Bin + log2(G) - i + 1; d(i) = Bout; end for i = 1:N*2 fprintf( '%i %i\r',i,d(i)); end and the output for bout is 1 25 2 26 3 27 4 28 5 29 6 30 7 31 8 32 9 33 10 32 11 34 12 36 13 38 14 40 15 42 16 44 17 46 18 48