home *** CD-ROM | disk | FTP | other *** search
/ ftp.disi.unige.it / 2015-02-11.ftp.disi.unige.it.tar / ftp.disi.unige.it / pub / .person / MassoneA / landec_nop.m < prev    next >
Text File  |  2004-11-15  |  927b  |  45 lines

  1. alpha=1.;
  2. disc=0.;
  3.  
  4. nameda=input('file dati?\n','s');
  5. namepsf=input('file psf?\n','s');
  6. iu=input('numero di iterazioni?\n');
  7.  
  8. namededa=sprintf('%s.dec%d',nameda,iu);
  9. namedepsf=sprintf('%s.dec%d',namepsf,iu);
  10. namebin=sprintf('%s.decbin%d',nameda,iu);
  11.  
  12. fd1 = fopen(nameda,'r');
  13. fd2 = fopen(namededa,'w');
  14. fd3 = fopen(namepsf,'r');
  15. fd5 = fopen(namebin,'wb');
  16.  
  17. aussk=fscanf(fd3,'%f');
  18. n=length(aussk);
  19.  
  20. k0=complex(aussk);
  21.  
  22. np=input('numero di proiezioni?\n');
  23.  
  24. for j=1:np,
  25.    auss=fscanf(fd1,'%f');        % vale se np=1, per sinogrammi verificare e cambiare!!!
  26.    g=complex(auss);
  27.    auxg=g;
  28.    G=fft(auxg);
  29.    %%%%%%%    Metodo LP %%%%
  30.    F1=complex(zeros(n,1));
  31.    IM=fft(k0);
  32.    ris=pricostr(F1,IM,G,iu,alpha);
  33.    %%%%%%%%%%%%%%%%%%%%%%%
  34.    fprintf(fd2,'%f\n',real(ris));
  35.    fwrite(fd5,real(ris),'uchar'); 
  36.    
  37.   % disc=disc+discrep(k0,ris,g);  
  38.    
  39. end
  40.  
  41. fclose(fd1);
  42. fclose(fd3);
  43. fclose(fd2);
  44. fclose(fd5);
  45.