% function as_savefft_volts(fname_load,fname_save) % David Cheung, 5/16/03 % % Loads the specified corrected data set and generates % the angular spectrum. Saves the angular spectrum to % the file specified. % % fname_load = filename to load % fname_save = filename to save % % Assumes file loaded contains: % data3D_dB(x,y,freq) in dB, data3D_phase(x,y,freq) in rad % Saves file containing: % as3D(x,y,freq) in linear power*m^2 % function as_savefft_volts(fname_load,fname_save) fname_load = input('Please enter the file name to load \n','s'); fname_save= input('Please enter the file name to save\n','s'); % load data, convert to complex (voltage) load(fname_load); % data3D_dB data3D_phase data3D_complex = 10.^(data3D_dB/20) .* exp(j*data3D_phase); clear data3D_dB data3D_phase; % perform 2D FFT num_pts = size(data3D_complex,3); for freq_index = 1:num_pts z = squeeze(data3D_complex(:,:,freq_index)); as3D(:,:,freq_index) = fftshift(fft2(z)); end; % save to specified file save(fname_save,'as3D'); % as3D(x,y,freq)