FCC Logo - Return to the FCC Home Page  
  Audio Division                                                               AMwave
(202)-418-2700
Fax: 202-418-1411

    Help | Advanced




Media Bureau Home
  Bureau Documents

  MB People
MB Divisions
  Office of the Bureau   Chief

  Audio Division

  Video Division

  Policy Division

  Industry Analysis   Division

  Engineering Division

  Office of   Communication &   Industry Information

  Management and   Resources Staff


The Audio Division

  Alphabetical Index

  Audio's Contact   Persons list

  Internet Queries

  Radio Tools Popup

  Conversions

  Most Requested   Information

  Major Subject Areas

  Audio Headlines

  Electronic Filing

Electronic Filing Skip Bureau and Office Links


Visit the FirstGov Portal
Easy, one-stop access to all online U.S. Federal Government resources
www.USA.gov

 

AMwave

Wavelength Calculations to 30 MHz
A Fortran POST CGI example

This program receives an input frequency (up to 30000 kHz = 30 MHz) and calculates the corresponding wavelength of that signal. Amplitude Modulation (AM) is generally used for transmissions below 30000 kHz (or 30 MHz). Below 30000 kHz may be found the Citizen's Band radio service, shortwave international broadcasters, AM radio band broadcasts, amateur radio bands, radionavigation beacons, and longwave broadcasting (the last only in Europe).


in kilohertz up to 30000 kHz maximum:
[ Do not include thousands separators: 1,000 is entered as 1000. ]



   


The source code for this program (HTML and Fortran CGI) is available for download. AMwave uses the POST method to receive data, reading the input string from standard input (STDIN). To retrieve the STDIN, we use a READ statement (usually on unit 5 for STDIN) containing an END statement, which executes once the end of the input string has been reached. The STDIN information is saved into a character string which is subsequently parsed to retrieve the name=value data pairs sent by the form.

  • FORTRAN:
    • In this example, the HTML output is established by the statements

         write(6,55)
      55 Format("Content-type: text/html"//)

      This code must be placed before any HTML statements are written to output. (Yes, you can change the Format statement number.) The two // are VERY IMPORTANT! Also, note the placement of the " quotation marks. Compare to the corrsponding C language statement

      printf("Content-type: text/html\n\n");

    • For HTML OUTPUT, the HTML tags are contained inside Format statements, as shown in the example Fortran code. BE SURE to have the usual HTML ending tags, or you may not see any HTML output or receive an execution error code.

    • Carefully watch use of  ' and " in Format statements: it's too easy to miss one ' or " or add too many.

    • When generating output, statements must be no longer than the 72 character limit in Fortran 77. Another Format statement or a continuation character in Column 6 may be used for longer statements.

    • A CGI can output a new HTML form, or call a CGI. The Fortran program can also incorporate subroutines, called in the usual manner, although none are needed for this example.

    • Fortran carriage control characters are unneeded when generating HTML output. Use the HTML tags to perform this function. However, to keep the browsers' source code view tidy, you can include returns at the end of HTML lines:

          write(6,111)
      111 format(" HTML text here! " /)

    • The program has not been optimized. There certainly are better ways to do some of the tasks or changes which could be made to reduce the code, but it's not necessary for this simple example. Please note that no Fortran or CGI library functions were used in the preparation or execution of this example. The program was designed as a stand-alone CGI.

    • A GET method CGI example (COLORIT) and a combined GET/POST example (Doppler-Shift) are also available for your review.

    Dale Bickel
    Senior Electronics Engineer
    Audio Division, Media Bureau

    Original page February 1999; revised March 25, 2002



  •      


    Please send comments via standard mail to the Federal Communications Commission, Consumer and Governmental Affairs Bureau, 445 12th Street, S.W., Washington, D.C., 20554. Questions can also be answered by calling the FCC's National Call Center, toll free, at 1-888-Call FCC (1-888-225-5322).

    Skip FCC Footer and Contact InfoFederal Communications Commission
    445 12th Street SW
    Washington, DC 20554
    More FCC Contact Information...
    Phone:  1-888-CALL-FCC (1-888-225-5322)
    TTY:  1-888-TELL-FCC (1-888-835-5322)
    Fax:  1-866-418-0232
    E-mail:  fccinfo@fcc.gov
    - Privacy Policy
    - Website Policies & Notices
    - Required Browser Plug-ins
    - Freedom of Information Act