Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You are a software developer at Handmade Aerial Solutions, LLC ( HASL ) , a company that builds radio antennas. Each antenna produced by HASL
You are a software developer at Handmade Aerial Solutions, LLC HASL a company that builds radio antennas. Each antenna produced by HASL is handcrafted for optimum reception at a specific frequency. Until recently, HASL produced primarily inch antennas for FM radio reception. However, changing market trends have forced the company to diversify its product line to include cell phones, wireless networking, and the hobbyist market.
You have been asked to develop a program to assist in the design of the new dipole antennas. This program will read as its input a frequency in megahertz, and calculate and display the optimum length for an antenna to receive signals of that frequency. In an ideal world, the antenna would be half the wavelength of the signal; however, the electrical properties of antennas require that they be only this long that is of the wavelength
The formula for calculating the wavelength lambda of an electromagnetic signal given its frequency F is:
lambda c F
Where:
lambda is the wavelength in meters
F is the frequency in hertz
c is the speed of light in meters per second
The formula for the optimum antenna length is:
L lambda
L is the antenna length in meters.
lambda is the wavelength in meters.
As with any problem, there are some quirks. First of all, the engineers want to enter frequencies in megahertz rather than hertz megahertz hertz Second, the contractors who handbuild the antennas are antimetric activists, and require that all lengths be specified in inches inch meters; the engineers, however, want to see the wavelength and antenna length in meters.
Your program should have the following design:
Display the HASL logo
Prompt the user for a frequency with the message "Enter the desired reception frequency in MHz:
Calculate the wavelength of the signal
Calculate the optimum antenna length
Display the signal wavelength in meters
Display the antenna length in inches
Display the antenna length in meters
Your program's output should look exactly like the following, including words, uppercaselowercase spaces, and newlines: user input is shown in red here, but will be the usual color when you run your script
Handmade
Aerial
Solutions
LLC
Enter the desired reception frequency in MHz:
The signal wavelength is meters.
The optimum antenna length is inches meters
Choose some input numbers and calculate the results by hand. You can use a calculator if desired. As you work, consider how you are doing this, what you are doing, what the numbers mean. That is how you will tell the computer to do it
Expand on the design given above. That is give more of the details at each step. Put this design in a text file, one step per line.
Write a header comment.
Turn your design into comments by adding at the beginning of each line then paste it inside your program.
Write MATLAB code to implement your design. For each step in the design, write a line or two of code to do that step.
Run your program. Eliminate the syntax and semantics errors. Also fix any warning messages you get. Make sure it does not produce extra output.
Test your program with different inputs. Test it with the numbers you chose for the handwork in the first step. Verify that it does come out with the correct answers. Capture test runs with different inputs. Your output should exactly match the sample run above, except that you might have more or fewer digits of precision on the numbers.
There are several specifications about how your program should be written.
This program uses input; you will have to prompt the user for it
Make sure you format the lines of the output exactly as shown in the example above. The decorations, line breaks, spacing, number of digits, and punctuation should be as shown. You will most likely need to use fprintf to get the correct formatting. See Chapter Section Links to an external site. and Chapter Section of the ZyBookLinks to an external site. for more details on fprintf.
Step : Testing
Run the program with two different sets of values. One set should be the ones in your handwork above. You can choose values for the other set. Test the program on unusual inputs. What happens with zeros? negative numbers? Your program doesn't have to be written to do anything special with these inputs, but you should think about and describe what happens when you try them. Write a description of this testing in a multiline comment at the end of your source file the m file
Step : Submission
Submit to Canvas your m file. It should run with no errors or warnings.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started