Digital Signal Processing Reference
In-Depth Information
% histogram of pairs x[n] and x[n+y] is computed
% h2d : parameters for bin settings
% h2d = [M1,MIN1,MAX1,M2,MIN2,MAX2]
% M1, M2 : number of equally sized bins
% MIN1, MIN2 : minimum value of bin centers
% MAX1, MAX2 : maximum value of bin centers
% c1, c2 : bin centers with respect to x and y respectively
% f2d : histogram (absolute frequency)
% hist2d.m * mw * 13Feb2011
Lx = length(x); Ly = length(y);
D1 = (h2d(3)-h2d(2))/(h2d(1)-1);
% width of bins of x
D2 = (h2d(6)-h2d(5))/(h2d(4)-1);
% width of bins of y
c1 = h2d(2)+D1*(0:h2d(1)-1);
c2 = h2d(5)+D2*(0:h2d(4)-1);
B1 = h2d(2)-D1/2;
B2 = h2d(5)-D2/2;
if Ly==1
% one sequence x and y=x[n+m]
m = y;
y = x(1+m:Lx); x = x(1:Lx-m);
Ly = length(y);
end
L = min(Lx,Ly); x = x(1:L); y = y(1:L);
x = ceil((x-B1)/D1); x = min(x,h2d(1)); x = max(x,1);
y = ceil((y-B2)/D2); y = min(y,h2d(4)); y = max(y,1);
f2d = zeros(h2d(4),h2d(1));
% histogram
for n=1:L
f2d(y(n),x(n)) = f2d(y(n),x(n)) + 1;
end
return
M14.8
Verschaffen Sie sich einen ersten Eindruck, ob der MATLAB-Zufallszahlen-
generator randn unkorrelierte Zufallszahlen erzeugt. Füllen Sie dazu Tabelle 14-7
aus. Für den Versuch verwenden Sie den MATLAB-Befehl aus der Signal Proces-
sing Toolbox xcorr beispielsweise in der Form
[R,l] = xcorr(randn(1e4,1),20,'unbiased');
Tabelle 14-7
Schätzwerte für die AKF R XX [ l ] der durch den MATLAB-Befehl randn
erzeugten Zufallszahlenfolge für den Stichprobenumfang N
N
R XX [0]
max( | R XX [ l ]| ) für l = 1, 2, ..., 20
10 4
10 5
10 6
Search WWH ::




Custom Search