function writewavelet2fft(ModDataMatcell)
%   This software is protected by german copyright and international treaties.             
%   Copyright 2004 Markus Junghöfer & Peter Peyk. All Rights Reserved.                     
%                                                                                          
%   THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE        
%   NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO,    
%   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE    
%   OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
%   TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT,       
%   INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE      
%   OR DOCUMENTATION.                                                                      

[savefilename,savefilepath]=uiputfile('*.txt','Please name ascii-result-file:');
savefile = [savefilepath savefilename];
fid = fopen(savefile,'wt');

%Header
%%j-ter Channel
fprintf(fid,'VP ');
for j=1:size(ModDataMatcell{i},1)
    %k-ter Punkt
    for k=1:size(ModDataMatcell{i},2)
        %l-te Frequency
        for l=1:size(ModDataMatcell{i},3)
            fprintf(fid,['ch',num2str(j),'p',num2str(k),'f',num2str(l),' ']);
        end
    end
end
fprintf(fid,'\n');


%i-te VP
for i=1:length(ModDataMatcell)
    fprintf(fid,[num2str(i),' ']);
    %%j-ter Channel
    for j=1:size(ModDataMatcell{i},1)
        %k-ter Punkt
        for k=1:size(ModDataMatcell{i},2)
            %l-te Frequency
            for l=1:size(ModDataMatcell{i},3)
                fprintf(fid,[num2str(ModDataMatcell{i}(j,k,l),' ']);
            end
        end
    end
    fprintf(fid,'\n');
end

fclose(fid);

ok;
edit(savefile);
return
    
                
                
        
    %NChan X NPoints X NFreqs
