diff options
Diffstat (limited to '692/CH5/EX5.4/P5_4.sce')
-rwxr-xr-x | 692/CH5/EX5.4/P5_4.sce | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/692/CH5/EX5.4/P5_4.sce b/692/CH5/EX5.4/P5_4.sce new file mode 100755 index 000000000..960f1dafd --- /dev/null +++ b/692/CH5/EX5.4/P5_4.sce @@ -0,0 +1,37 @@ +//EXAMPLE 5.4 +//DETERMINE IDFT OF GIVEN SEQUENCE +clc; +clear; +K = input(" value of K "); +disp('input M > K'); +M = input(" value of M "); +k1 = 0:K-1; +V1 = k1./K;//DFT +k=0:M-1; + +N = length(V1); +V = [V1,zeros(1,M-N)]; +v = dft(V,1);//IDFT + +clf(); +subplot(1,2,1) + +a = gca(); +plot2d3(k,real(v),2); +plot(k,real(v),'r.'); +a.x_location = 'origin'; +a.y_location = 'origin'; +poly1 = a . children (1) . children (1) ; +poly1.thickness = 2; +xtitle('real part','N','v'); + +subplot(1,2,2) +a = gca(); +plot2d3(k,imag(v),2) +plot(k,imag(v),'r.'); +a.x_location = 'origin'; +a.y_location = 'origin'; +poly1 = a . children (1) . children (1) ; +poly1.thickness = 2; +xtitle('imaginary part','N','v'); +v = disp(v); |