- May 15, 2020
EGB342 Assignment 2B (25%) Released: Tuesday, 24th September Due: Sunday 20th October, 11:59pm (Week 12) Group Assignment – Group of 3 students Congratulations! Fraser Island tourism manager Natalie has just confirmed that the commis- sioning of the communication link between Fraser Island and the mainland was a success. With the easy access routes to the Island and the commissioning of new communication infrastruc- ture, Fraser Island has become one of the most sought-after holiday destinations. However, the Fraser Island tourism board has found that the existing infrastructure is not sufficient to deal with the increase in tourist numbers. Therefore, they have commissioned your team to design and test a wireless communications solution to the island. As you will see from the following tasks, each team will be required to wirelessly send informa- tion to the mainland. This involves recording an audio message, quantizing, designing a source encoder and a decoder, transmiting digital data using band pass modulation and implementing appropriate receivers. *Reminder* Read the entire document before attempting the questions Detailed instructions on report format and submission guidelines are provided at the end of this document. All solutions must be implemented in MATLAB unless instructed otherwise. The submitted report must be a standalone document that can be read without reference to this brief, or the submitted code. 1 Preliminary Instructions Download all files to be used in Assignment 2B from blackboard and place them into one working directory. Please also unzip the contents of Assignment2B.zip into this directory. There are 3 files contained within Assignment2B.zip: 1. EGB342 A2B Template.m – implement your code solution in this file. 2. initialise.m – generate the data used in this assignment. 3. RecordAudio.p – called by initialise.m. Workspace Preparation Open initialise.m with MATLAB and read its instructions. Proceed to insert your group number and student IDs into the script and generate your data for this assignment. First, you need to record an emergency audio message using an external microphone or the computer microphone. Run the initialise.m script and record the following message when prompted. “Emergency! Emergency! Please vacate the beach immediately..!” This will record and store 5 seconds of audio into A2BData.mat. Load A2BData.mat to obtain the recorded audio sample (audio sample) and listen and verify the quality of your recording using the following command: Fs=8000; sound(audio sample,Fs); If the audio is not recorded properly run the initialise.m script and record the audio again. Overview As Wireless spectrum is limited, it is important to improve the spectral efficiency of the trans- mission. Figure 1: Process of Converting Analogue Signals to Binary Data Figure 1 shows the process of converting analogue signal, xc(t), to binary data, c[n]. Sampled signal, x[n] = xc(nT ) is quantized to get xˆ[n] before binary encoding. Binary encoder could be pulse coded modulation (PCM) or a suitable source encoder such as Huffman code. 2 PCM encoded audio does not use any form of compression. The sampling rate of PCM can vary between 8000 to 192 000 samples per second and word length of each sample can vary from 8 to 24 bits. The WAV recording file types contain the unprocessed PCM data. However, for Part 1 we will initially use a sampling rate of 8000 and a word length of 3 bits. Huffman code is a lossless code. Lossless coding algorithms allow the exact reconstruction of the original source data from the compressed data. Lossless coding can provide a reduction in bit rate compared to the original data, when the original signal contains dependencies or statistical properties that can be exploited for data compaction. It is also referred to as noiseless coding or entropy coding. Lossless coding can only be employed for discrete-amplitude and discrete-time signals. Your first task is to generate an appropriate Huffman code to encode the recorded audio mes- sage. Part 1 – Creating a Source Encoder/Decoder for Audio Messages 1.1 Load A2BData.mat to obtain the recorded audio sample (audio sample). Use the sam- pling frequency (Fs) to create a time vector and plot audio sample with correct time scale. 1.2 Quantize the audio sample using a uniform quantizer with 8 levels. If the number of levels is L and the step size is ∆, quantized audio samples can be obtained from: quantized audio = ⌊ normalised audio sample + 1 ∆ ⌋ ×∆ + ∆ 2 − 1 where normalised audio sample = audio sample/max(abs(audio sample)) 1.3 Plot and compare the normalised audio sample and quantized audio. Play and in- spect the quantized sample for intelligibility. You can use the command sound(audio,Fs) to play audio samples. 1.4 Generate and tabulate the frequency and probability table for the quantized audio sample values. 1.5 Use this table to construct a Huffman code to transmit the quantized audio sample. Generate and tabulate the code dictionary. Show your working in the report. 1.6 Write a MATLAB procedures to encode (audio enc) and decode (audio deco) the quan- tized audio sample and plot the output of the Huffman decoder and compare that with the quantized audio sample (normalised audio sample). 1.7 Calculate the following for your source encoding and decoding process: • Entropy and entropy rate of the quantized audio. • Average codeword length and the efficiency of the code. • The rate at the output of the Huffman encoder in bits/s. • The rate required in bits/s if Huffman encoding is not used (PCM output). 3 1.8 Investigate and report on the effects of quantization levels and the sampling rate on the intelligibility of the recorded audio and the complexity of the system. Assume that the Huffman encoder and decoder are used for this task. 1.9 Research and describe the details of one of the modern speech encoders. Part 2 – Testing the Wireless Channel You have been allocated a 25 kHz channel centred around 96 kHz, and therefore, the carrier frequency (fc) of your transmission needs to be as such. Null-to-Null bandwidth of your mod- ulated signal should not exceed 24 kHz. In this section you will test the suitability of binary phase shift keying (BPSK) to transmit the digital audio messages. Set up your simulation to transmit binary messages from Part 1, with 128 samples (i.e. NumPts=128) for each transmitted symbol (each bit). 2.1 Define the variable Nb to be the number of bits in your simulation sequence. Set this variable to length of the binary message created earlier (audio enc). 2.2 Initialise the variables for the carrier frequency (fc), symbol rate (Rs), number of samples per symbol (Ns), and the sampling rate (fs). Store these values as fc, Rs, NumPts, and fs respectively. The sampling rate is the symbol rate times the number of samples per symbol. 2.3 Create a time vector for your signal and store this as t. Additionally, create a frequency vector for the corresponding FFT and store this as f. 2.4 Create a cosine wave at 96kHz using the cos function (c = cos (2pifct)). The peak magnitude of the carrier waveform at the transmitter is 1V. 2.5 Convert the binary data to bipolar data and store as x. 2.6 Oversample the bipolar binary data sequence so that each bit is Ns samples in length and store it as m. You can do this quickly with the kron function, i.e., kron(x, ones(1,Ns)). Your resulting vector should have a length of Ns×Nb samples. Multiply the oversampled binary data, m with the carrier waveform c. Store this signal in the variable y. Plot the first 500µs of this transmission. Comment on your observations. 2.7 Plot the spectrum of y. What is the bandwidth of the signal (the width of the main lobe)? Does this satisfy the requirements described above. What are the two major issues in transmitting this signal given the channel constraints? 2.8 Assuming no channel distortions recover the bit sequence using a correlation receiver1. This can be easily implemented using the reshape and sum functions. Perform this by multiplying the signal vector again with the cosine wave, and reshape the result to a Ns × Nb matrix. Summing each column will result in the correlation receiver output. Normalise the magnitudes by dividing by the number of samples. Recover the binary data (bipolar) from these samples. Use a single line of MATLAB code to calculate the bit error. Comment on the calculated result. 1Though mathematically identical to a matched filter, the algorithm described here better matches that of a correlation receiver. 4 2.9 Convert the received binary bipolar data back to binary format and recover the audio message using the Huffman decoder constructed in Part 1. 2.10 If the peak magnitude of the carrier at the receiver is 60 µV, estimate the total power loss in dB due to wireless propagation. 2.11 Re-transmit your BPSK signal with a carrier frequency of 196 kHz. How does varying fc affect your signal and its spectrum? What are the bandwidth requirements and the achievable data rates in this case? 2.12 Lower the sampling rate, NumPts, to 64 samples/symbols (with a 96 kHz carrier). How does varying fs affect your signal and its spectrum? What are the bandwidth requirements for this sampling rates? You will need to plot the spectrum with an appropriate frequency range. What is the data rates, and how long would it take to transmit the audio message? 2.13 Simulate and plot the bit error rate performance of the above modulation in the Eb/N0 range 0dB to 12dB. Here: snr (dB) = EbNo (dB) + 10*log10(2) – 10*log10(NumPts) Compare the simulated error rate performance with the theoretical bit error rate per- formance of BPSK. Theoretical bit-error-rate probability of BPSK modulation is given by; Pb = Q (√ 2Eb N0 ) 2.14 Mean Opinion Score (MOS) is often used for subjective evaluation of audio quality (in- telligibility) which listeners rate the quality of the test signal using a five-point numerical scale shown below. Rating Speech Quality Level of Distortion 5 Excellent Imperceptible 4 Good Just perceptible, but not annoying 3 Fair Perceptible and slightly annoying 2 Poor Annoying, but not objectionable 1 Bad Very annoying and objectionable Transmit your Huffman coded message through a channel with Eb/N0 from 0dB, to 12dB (increment Eb/N0 by 1 dB in each step) and assess the audio quality according to the MOS score given above. Each member of the group should assess the audio quality independently and tabulate the results for each of the above Eb/N0 values. Assuming minimum MOS required is 3, decide the minimum acceptable Eb/N0 required at the receiver. 5 2.15 Assess (each member) and tabulate the received voice quality at Eb/N0 = 0 to 12dB (increment Eb/N0 by 1 dB in each step) for L = 4 and L = 256 and decide the minimum acceptable Eb/N0 required at the receiver. Comment on your observations. For this step you can use following steps to encode and decode using Huffman codes: • dict = huffmandict(symbol alphabet,symbol probability); Code dictionary • encoded bits = huffmanenco(quantized audio,dict); Encode • decoded symbols = huffmandeco(encoded bits,dict); Decode Part 3 – Performance of Multi-Level Modulation Schemes While the Fraser Island tourism manager is reviewing your solutions to the previous tasks of establishing a wireless link, she is investigating the possibility of transmitting the live security video feed using a wireless link. As video signals from number of security cameras from around the island is multiplexed before the transmission, the data rate of the wireless channel varies. Fraser Island tourism was able to secure a 5.25 MHz spectrum around 700 MHz range from the Australian Communications and Media Authority (ACMA). In this task you need to choose an appropriate modulation scheme to transmit the video feed with the given data rate using the allocated radio spectrum (5.25 MHz). Your team is also tasked to test the performance of a modulation scheme chosen for this purpose. Raised cosine pulse shaping is assume. You can use built-in MATLAB functions for this task (useful MATLAB functions: qammod, awgn, scatterplot ). Load A2BData.mat to obtain the data rate allocated to your team. The data rate in Mb/s is stored in the variable called ChannelDataRate and the Roll-Off factor of the raised cosine filter, r is stored in the variable called RollOffFactor. 1. Choose a suitable M -QAM scheme to transmit the data at the given rate, draw the corresponding constellation diagram, and label the constellation points using appropriate bit sequences. Justify your selections and constellation point labelling. 2. What is the actual bandwidth required to transmit the given video data using this mod- ulation scheme and raised cosine pulse shaping? 3. Simulate and plot the bit error rate performance of the modulation scheme in a Eb/N0 range which is suitable to observe the bit-error-rate up to 10−6. Signal-to-Noise Ratio (SNR) of the signal can be calculated using the following expression. Hint: You can use base-band simulation without the carrier. snr = EbNo + 10*log10(k) – 10*log10(NumPts); Here k is the number of bits per modulated symbol. For based band simulation NumPts=1. 4. Compare the simulated performance to the theoretical error probability, and comment on the results. 5. Plot the scatter plot of the received noisy signal for Eb/No values of 0dB, 5dB, 15dB, 25dB and 35dB and comment on your observations. 6 6. If the maximum acceptable bit-error rate at the receiver is 10−5, calculate the minimum transmit power required at the Fraser Island transmitter station. Use the following pa- rameters of the wireless link, • Transmit antenna gain = 5 dB and Receiver antenna gain = 5 dB • Cable loss at the transmitter = 2 dB and Cable loss at the receiver = 2 dB • Path-loss of the wireless link = 80 dB • Noise power spectral density at the receiver = 10−12 W/Hz The relationship between received power, Prx and the transmitted power, Ptx is given as; Prx [dB] = Ptx [dB] + Gains [dB]− Losses [dB] [Hint: First calculate the Prx using the minimum Eb/N0 required to achieve the bit error rate of 10−5 based on the modulation scheme you selected.] 7. Describe the advantages and disadvantages of higher order modulation schemes. Reflection (Mandatory) A reflection is to be written and appended to the end of your report. Include a short discussion (150 to 200 words) that addresses problems encountered, and things that you would have done differently. Identify what concepts this assignment has reinforced, and areas where you can improve. This section is mandatory and the assignment is regarded as incomplete if absent. Academic Integrity Declaration and Group Dynamics – Individual (Mandatory) Each group member must individually complete the ‘Academic Integrity Declaration and Group Dynamics’ online form using the provided link on Blackboard. Individual marks will be withheld if this is not completed, or if the declaration is not agreed to. In the group dynamics portion, allocate the percentage contribution of each group member. If you wish, you may add additional text and request the teaching team review member contribution. If you experience issues with group members before the due date, please contact the teaching team via email. If your issues are in hindsight, please give details here. Interview (Mandatory if requested) Interviews will take place (at the discretion of the teaching team) to assess the conceptual understanding. This will be a casual discussion. These interviews are compulsory and grades are withheld until they are completed. Marks may be deducted for poor demonstration of content/assignment knowledge. These interviews will only be for selected groups, and you will be notified if you need to take part in an interview. 7 Presentation Standards This assignment includes elements of written and coding assessment. You are expected to work as a group. Each group is expected to generate and submit one assignment report and one set of MATLAB code. Marks are based on how easily and effectively ideas are articulated to the reader. The teaching team has put together some things to consider – The Report Component An outstanding report demonstrates knowledge and understanding of the subject area. It communicates ideas clearly and logically with a combination of visual, mathematical and code assets. It demonstrates insight about the underlying concepts and their implications within telecommunications and signal analysis. Verbose responses, or correct information not articu- lated clearly, will attract deductions. Remember that you are writing to inform. Mathematical working shows a logical procedure (or justification) for the final solutions i.e. All non-trivial steps are included. It can be typed or handwritten but must be legible and easily followed. Code snippets used in-text should only contain relevant lines of code and should rarely have more than five lines in a snippet. Present the report so that it can be understood without reference to the assignment brief. Any figures or code referenced within the code should be no more than one page turn away. Avoid the use of “see appendix” and “refer to .m file”. Document flow and coherency is to be priori- tised. Reports that are difficult to navigate are marked poorly in this criteria. Write the report assuming that the reader only knows concepts from 1st year engineering and does not have access to your .m file/s. Include a title page that states the unit name, unit code, assignment number, your name(s) and student number(s). Do not include a table of contents, list of figures, nor a list of tables. Convert the report to the PDF file format before submission. This ensures document typesetting is preserved across different computers running different operating systems. The Code Component The submitted code needs to be executable (in MATLAB R2016b or later) and without run- time error. If an error is encountered at execution, your assignment will only be marked until the error. No error correction will be made to make your code ‘run’. Coding for this assignment should remain within one (provided) file (unless otherwise explicitly instructed). Only include a separate .m file if absolutely necessary. 8 Code should be fully commented to describe intent. Comments should contain enough informa- tion to understand the process without referring to the report. Quality comments encapsulate your understanding of the topic. * You may use the code provided in the weekly tutorials to check your solutions, however you are expected to generate your own code for your assignment. Submitting supplied .p code as your own work constitutes academic misconduct and will be considered a run-time error. * Acknowledgement Front page image from https://www.frasercoastchronicle.com.au/news/optus-invest-6m-improving-reception/3178731/ . Submission Check-list Submission deadline is on the Sunday, 20th October 2019, 11:59 pm. This will be a hard deadline and late submission penalties will apply. As per QUT policy, late assignments receive 0 marks. The report, in PDF format, submitted to Turnitin via the Blackboard link (1/3) A .zip file, submitted directly to QUT Blackboard via the provided link, that contains (2/3) – • EGB342 A2B Template.m with your name and ID • A2BData.mat – • Functions that are written as a result of explicit assignment instruction • Any other MATLAB scripts you have developed Submissions have been re-downloaded from submission portals and run as-is to confirm successful upload. Completed Academic Integrity Declaration on-line form (3/3) Submission FAQ ⇒ You do not need to assign your submission with a special name. Blackboard assigns unique IDs to all submissions. The submission link is accessible through: EGB342 19se2 → Assessment → Assignment 2B → Assignment 2B: Submis- sion. ⇒ You may submit as many times as you like before the deadline. New submissions overwrite old submissions. Only the latest submission is recorded and marked. Upload in-progress versions so there is something to mark if your final submission is late. 9 ⇒ All documents can be reviewed after submission and thus it is your responsibility to verify that the uploaded documents are not corrupt. Corrupt files are treated as incomplete assignments. ⇒ Be aware that the electronic time stamp is placed only after all files have uploaded. Blackboard may experience high traffic or your connection may fail unexpectedly. Begin your final upload at least an hour before the deadline. Hardship If you experience a hardship which affects your ability to complete, or contribute to, this assignment, please contact the teaching team as soon as it occurs. QUT also offers counselling services if required. 10 EGB342 Assignment 2B: Group 2019 1 Criteria Standards 7+ 7 6 5 4 3 2/1 CR1 – 50% weighting Theoretical understanding Key Milestones – Huffman encoding and Decoding – Implementing and recovering BPSK – M-QAM performance Demonstrates understanding of the mathematical concepts underpinning this assignment beyond the expected ‘7’ level. Explanations and justifications are unambiguous, accurate and logical. Graphical and mathematical tools are used masterfully to convey knowledge of all topics. Uses appropriate terminology. Has no conceptual errors, but one minor technical/numerical error may exist. Discusses all required concepts and shows evidence of further research. Demonstrates in-depth understanding of the fundamental concepts in this assignment. Explanations and justifications are generally clear, accurate and logical. Graphical and mathematical tools are used fittingly to convey knowledge of all topics. Uses appropriate terminology. Has no conceptual errors, but one minor technical/numerical error may exist. Discusses all required concepts. Demonstrates strong understanding of the fundamental concepts in this assignment. Explanations and justifications are generally accurate and logical. Graphical and mathematical tools are used satisfactorily to convey knowledge of all topics. Uses appropriate terminology. Has no conceptual errors, but minor technical/numerical errors exist. Discusses all required concepts. Demonstrates sound understanding of the fundamental concepts in this assignment. Explanations and justifications are generally accurate and logical. Graphical and mathematical tools are used satisfactorily to convey knowledge of most topics. Uses appropriate key terminology. One minor conceptual error and no more than two technical/numerical errors may exist. Discusses all key concepts. Demonstrates rudimentary understanding of the fundamental concepts in this assignment. Explanations and justifications are generally accurate and logical but are sometimes unclear. Graphical and mathematical tools are used adequately to convey knowledge of most topics. Uses appropriate key terminology. Only minor conceptual, technical or numerical errors exist. Discusses most key concepts. Conceptual understanding is not demonstrated explicitly OR Major conceptual error OR Discussion does not demonstrate understanding of the expected ‘4’ level. Incorrect interpretation/s of underlying concepts i.e. Multiple major conceptual errors. Does not recognise basic errors when discussing generated diagrams. CR2 – 20% weighting Effective written communication Key Milestones – Informative – Easy to read – Clearly explained core ideas – Reflection demonstrates intended learning outcomes Professional format, insightful, core technical ideas are clearly, accurately and succinctly conveyed. The report is very easy to read, and has been written to inform. Only relevant code included in snippets. Figures demonstrate intended point excellently. Referencing is present, and has been done correctly (IEEE). Reflection shows all learning outcomes were reached. Professional format, core technical ideas are clearly and accurately conveyed. The report is easy to read, and has been written to inform. Mostly relevant code included in snippets. Figures demonstrate intended point very well. Reflection shows all learning outcomes were reached. Professional format, technical ideas are clearly conveyed, one minor inaccuracy. The report is informative and easy to read. Mostly relevant code included in snippets. Figures demonstrate intended point well. Reflection shows most learning outcomes were reached. Report format is adequate but missing some coherence in its structure. The report is difficult to read in one or two sections. Consistently irrelevant code included in snippets. Figures demonstrate intended point satisfactorily. Reflection shows some learning outcomes were reached. Report format is missing several critical explanations. The report is difficult to read in several parts. Large amounts of irrelevant code included. Figures demonstrate intended points adequately. Little evidence of reflective thinking. Report formatting was attempted. Contains little, or vague, discussion and lacks cohesion. Largely a code and figure dump. No evidence of reflective thinking. The report has little or no structure. No evidence of reflective thinking. CR3 – 30% weighting Application using Coding Key Milestones – For a 7 in this criteria, all milestones must be satisfactorily reached; For a 6, most must be satisfactorily reached, and so on. • Correct individual-question outputs as per solution-script options Code appears to give correct outputs if widely-varying solutions are possible • Code is optimised (i.e. makes use of vectorisation where appropriate) • Comments are effectively used to describe the code • No runtime errors • Uses functions that are within the scope of the assignment • Code achieves desired output/s on completion Large sections of code incomplete OR Multiple runtime errors For moderation of overall marks: At the discretion of the teaching team, your group may be selected to attend an interview if the teaching team require clarification about how the group arrived at their solutions, or how individuals contributed to the overall solution. If selected, you will be notified and given details of the location and time of the interview. Oral interview Demonstrated knowledge is consistent with submitted report and code. No moderation of marks. Demonstrates knowledge noticeably below the standard of the submitted report and code. Individual marks may be moderated down up to 20%. Demonstrates knowledge significantly below the standard of the submitted report and code OR Does not attend interview. Individual marks may be moderated down up to 100%.