How to Convert Varian NMR spectra into DNMR5 format


These notes use nmrsun2 as the host computer. If you are using a different workstation as the local host, substitute the name of your local workstation for nmrsun2 in the commands below.
  1. Process your spectrum. Remember the number of the experiment area where you processed your spectrum. Remember the value of sw. Remember the limits of the region to be fitted in DNMR5 (in Hz). Type dres; the Using the listed Hz/point, calculate the number of points in the region of interest: it can't be greater than 10290. Type flush.
  2. Connect to a computer with MatLab.
    For example, type xhost zinc, then telnet zinc
  3. Get your data from the NMR Facility.
    Type setenv DISPLAY nmrsun2.chem.indiana.edu:0.0
    Type ftp nmrsun2.chem.indiana.edu
    Login with your user name and password.
    Type cd vnmrsys/exp#/datdir where # is the number of the experiment area where you worked up your spectrum.
    Type bin
    Type get phasefile
    Type quit
  4. Optional step: To rename your file phasefile to a unique name, type mv phasefile newfilename. Substitute this new file name for phasefile in the commands below.
  5. Start MatLab.
    Type matlab
    You should see a temporary logo window on the nmrsun2 display.
  6. Read your spectrum into a 1D array.
    Type fid=fopen('phasefile','r','b');
    Type [C]=fread(fid,'float32');
    Type C=C(16:size(C,1));
    At this point, variable C contains the full spectrum as a 1D array.
  7. Measure Type size(C)
    The length and width(1) dimensions of C will be listed. Calculate the Hz/point coefficient (i.e., sw/length). Convert the limits of the region to be fitted (from VNMR) to points. lfl is the low frequency limit and hfl is the high frequency limit of this region. Of course, lfl and hfl must be integers.
  8. Select a region of the spectrum.
    Type D=C(lfl:hfl); where lfl is the low frequency limit (in points) and hfl is the high frequency limit (in points) from the last step.
    This copies the region from the full spectrum and stores it in a matrix D. The length of D can't be greater than 10290.
  9. Optional Step to remove unwanted peaks from the spectral region.
    Type plot(D); to plot the spectral region.
    Type zoom on Double-click on the top window bar toggles the window size from full to original.
    Drag the left muse button on the figure screen to expand the region of unwanted peaks. Double-clicking on the figure restores zooming. Note the X-limits of the peaks to be removed (i.e., points a through b).
    Type D(a:b)=0; to assign the points betwene the limits to zero.
    Close the Figure Windows by clicking on the [rhomb_button+Q]---don't try the File/Exit menu.
  10. List the maximum value.
    Type max(D). This lists the maximum value of the spectral trace in the selected region (i.e., maximum value=p). Note the value of K in p*10eK=P appropriate to convert p into a number with five significant figures, since P has 5 significant figures.
  11. Type D=round(10eK*D);
    where K was determined in the previous step. This rounds off the trace to fit the DNMR5 format.
  12. Create a new file.
    Type fid=fopen('new_file_name','w');
    where new_file_name is the name of the new file.
    Type fprintf(fid,'%5.0f%5.0f%5.0f%5.0f%5.0f%5.0f%5.0f%5.0f%5.0f%5.0f%5.0f%5.0f%5.0f%5.0f%5.0f%5.0f\n',D);
    all on one line.
    Type fclose(fid);
    to end.

Back to NMR Facility Home Page
Send comments to chemnmr@indiana.edu

Last updated: Dec 9, 1998
URL: http://nmr.chem.indiana.edu/NMRguide/misc/dnmr5.html
Copyright 1996, The Trustees of Indiana University