Question: Question 4 : Sound Synthesis [ 3 0 marks ] Square waves are particularly useful in electronics as they can represent low and high states
Question : Sound Synthesis marks
Square waves are particularly useful in electronics as they can represent low and high states they only have states We can also create audio forms with square waves. Like any periodic waveform, square waves will have an amplitude and frequency.
In WAVE files, this square wave can be represented using the minimum and maximum values of bit depth, ie in a WAVE file with a bit depth of high states will be represented with the number and low states will be represented with the number
Write a MIPS program, called questionasm, that will generate square waves. You will need to obtain, from the user in this order the full output file name the entire path the tone frequency how many times a wave period will appear within a second, an integer the sample frequency how many sound samples will be measured in a second, an integer and the length of the tone an integer in seconds
Your output file should have channel only and a bit depth of You should ignore the contents of the header: set all bytes of the header to Your tone should always start with the high state. You may assume that the tone frequency, sample frequency and length will be such that there will always be an even number of samples per wave period.
Note: for this question, the Automarker will not check your console output and there should not be console output, only input It will only check your output file. When it prints your output file, it will convert your binary file to a textual hexadecimal form.
Sample Console Input do not place the comments in the program input:
homelynnDocumentsCSCSassignqtout.wav
# tone frequency
# sample frequency
# length of the tone
Sample File Output represented as text using xxd:
:
:
: ff f ff f
: ff f ff f ff f
: ff f ff f ff f ff f ff f
:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
