What should I comment on change in contrast with changing A and B?
Let s(x,y) = A + B sin[2π(u0x + v0y)] be a 2D sinusoidal signal (image) with u0 and v0 representing the fundamental spatial frequency in x and y directions respectively. Plot s(x,y), sampled at Δx = Δy = 0.01, from 0 to 1.99 in both directions for the following values of u0, v0, A, and B, and comment on change in contrast with changing A and B:
a. u0 = 2 and v0 = 0, B = 0, A = 50b. u0 = 2 and v0 = 0, B = 10, A = 50c. u0 = 2 and v0 = 0, B = 25, A = 50d. u0 = 2 and v0 = 0, B = 50, A = 50.
This is the matlab code I wrote:
dx=0:0.01:1.99;dy=0:0.01:1.99;%a.u0=2 and v0=0
u0=2;v0=0;%a.A(vertical shift)=50, B(Amplitude)=0
A=50;B=0;sxy=(A+B*(sin(2*pi*(u0*dx+v0*dy))));subplot(2,2,1);plot(dx,sxy,'k');xlabel('0\leqx\leq1.99');ylabel('s(x,y)');title('Plot of sin(4\pix)+50');%b.u0=2 and v0=0
u0=2;v0=0;%b.A(vertical shift)=50, B(Amplitude)=10
A=50;B=10;sxy=(A+B*(sin(2*pi*(u0*dx+v0*dy))));subplot(2,2,2);plot(dx,sxy,'k');xlabel('0\leqx\leq1.99');ylabel('s(x,y)');title('Plot of 10sin(4\pix)+50');%c.u0=2 and v0=0
u0=2;v0=0;%c.A(vertical shift)=50, B(Amplitude)=25
A=50;B=25;sxy=(A+B*(sin(2*pi*(u0*dx+v0*dy))));subplot(2,2,3);plot(dx,sxy,'k');xlabel('0\leqx\leq1.99');ylabel('s(x,y)');title('Plot of 25sin(4\pix)+50');%d.u0=2 and v0=0
u0=2;v0=0;%d.A(vertical shift)=50, B(Amplitude)=50
A=50;B=50;sxy=(A+B*(sin(2*pi*(u0*dx+v0*dy))));subplot(2,2,4);plot(dx,sxy,'k');xlabel('0\leqx\leq1.99');ylabel('s(x,y)');title('Plot of 50sin(4\pix)+50');
Best Answer