Hi all,
i know there is a toolbox created by Richard Schreier (delsig.zip in mathwork). currently i am trying to use it, but i found the simulation i got is different from what the author did in his book (page 264, 265). i use the exactly the same code he provided but the output waveforms are different and the SNR values are also different.
is there any one tried this toolbox and really used it in your design works? is the toolbox reliable? any limitation i should pay attention?
thanks in advance and please share your experience if you have.
btw, i would like to discuss this toolbox more if anybody here is using it right now.
oh, ***, just let me find this.
I meet this problem too. My result is "SNR = 86.1 dB @ OSR = 64" without window, "SNR = 85.7 dB @ OSR = 64" with window. " like the window doesn't work or the toolbox does.
I follow the book step by step, this is my code:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear;
clc;
close all;
%synthesizeNTF
OSR= 64;
H= synthesizeNTF(5, OSR, 1);
nLev= 3;
Nfft= 2^ 13;
tone_bin= 57;
t= [0: Nfft- 1];
u= 0.5* (nLev- 1)* sin(2* pi* tone_bin/ Nfft* t);
v= simulateDSM(u, H, nLev);
n= 1: 150;
stairs(t
, u
, 'g');
hold on;
stairs(t
, v
, 'b');
%NTF simulation, SQNR cal and spectral estimation without window
spec = fft(v)/(Nfft*(nLev-1)/2);
snr = calculateSNR(spec(1:ceil(Nfft/(2*OSR))+1),tone_bin);
NBW = 1/Nfft;
f = linspace(0,0.5,Nfft/2+1); %this may be ahead?
Sqq = 4*(evalTF(H,exp(2i*pi*f))/(nLev-1)).^2/3;
figure; %add a new figure
plot(f,dbv(spec(1:Nfft/2+1)),'b')
hold on;
plot(f,dbp(Sqq*NBW),'m','Linewidth',1);
s= sprintf('SNR= %4.1fdB @ OSR= %2.0f\n', snr, OSR);
text(0.05, -20, s);
%NTF simulation, SQNR cal and spectral estimation without window
spec = fft(v.*(hann(Nfft)'))/(Nfft*(nLev-1)/4); %convert hann(Nfft) to vector matrix
snr = calculateSNR(spec(1:ceil(Nfft/(2*OSR))+1),tone_bin);
NBW = 1.5/Nfft;
f = linspace(0,0.5,Nfft/2+1); %this may be ahead?
Sqq = 4*(evalTF(H,exp(2i*pi*f))/(nLev-1)).^2/3;
figure; %add a new figure
plot(f,dbv(spec(1:Nfft/2+1)),'b')
hold on;
plot(f,dbp(Sqq*NBW),'m','Linewidth',1);
s= sprintf('SNR= %4.1fdB @ OSR= %2.0f\n', snr, OSR);
text(0.05, -20, s);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I use matlab r2011b for windows 64bit;
hope someone's help , 3x!!!
I have tried the matlab 2008a, the result is the same..