Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

EGB342 Assignment 2B (25%)

Released: Thursday, 6th October

Due: Sunday 30th October, 11:59pm (Week 13)

Group Assignment - Group of 3 students

With the successful completion of the Marble Island project, you teamed up with two other electrical engineers to start a Queensland based, signal analysis and telecommunications company. Your first client is the Queensland Government, who are planing to improve its telecommunica- tions infrastructure for emergency services to support its plans to host the 2032 Olympics. Your company has been engaged to design and test this wireless system for emergency communications system.

You are expected to complete this project by 30th October and provide a detail technical report to the Queensland Government accurately documenting design and analysis of the proposed system. Your report will be assessed according to the given criteria before awarding the contract to commission and implement the system.

As the system will primarily be used for voice communications, you will test your design and evaluate its performance in the presence of noise and attenuation using a recorded speech sample. You need to perform the following tasks to complete the project successfully,

1. Recording a speech sample.

2. Quantize the speech sample.

3. Design lossless source encoder to compress the speech.

4. Implement appropriate digital bandpass transmitters and receivers.

5. Evaluate the quality of the speech signal for different transmitter parameters noise levels.

*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.

Preliminary Instructions

Download all files to be used in Assignment 2B from blackboard, unzip the content and place them into one working directory. There are 2 files contained within Assignment2B.zip:

1. GenerateData.m - generate the data used in this assignment.

2. RecordSpeech.p - called by GenerateData.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 speech message using an external microphone or the computer microphone. Run the GenerateData.m script and record the following message when prompted.

Cyclone Oma continues to produce strong winds and flash flooding in our local area.

This will record and store 5 seconds of speech into A2BData.mat.

Load A2BData.mat to obtain the recorded speech sample (speech sample) and listen and verify the quality of your recording using the following command:

If the speech is not recorded properly run the initialise.m script and record the speech again. If you have trouble recording the audio, you can use the given test sample.wav for initial testing. Use the audioread function to load the test sample.wav to the MATLAB workspace.

Overview

As wireless spectrum is limited, it is important to improve the spectral efficiency of the transmission.

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 lossless source encoder.

PCM encoded speech 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

 

Figure 1: Process of Converting Analogue Signals to Binary Data

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 4 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 speech message.

Part 1 – Creating a Source Encoder/Decoder for Speech Messages

1.1 Load A2BData.mat to obtain the recorded speech sample (speech sample). Use the sampling frequency (fs) to create a time vector and plot speech sample with correct time scale.

1.2  Quantize the speech sample using a 4-bit uniform quantizer. Choose “midtread” or “midrise” quantizer and justify your selection.

1.3 Plot and compare the normalised speech sample and quantized  speech.  Play  and  inspect the quantized sample for intelligibility and comment on the observations. You can use the command sound(speech,fs) to play speech samples.

1.4 Generate and tabulate the probability table and construct a Huffman code. Tabulate and show your code construction process in the report.

Do not use huffmandict() to generate the code dictionary at this stage.

1.5 Write MATLAB procedures to encode (speech enc) and decode (speech deco) the quan- tized speech sample and plot the output of the Huffman decoder and compare that with the quantized speech sample (quantized speech).

Do not use huffmanenco() or huffmandeco() to encode or decode the quantized signal.

1.6 Calculate the following for your source encoding and decoding process:

• Estimate the entropy and entropy rate of the quantized speech.

• Estimate the uncoded (PCM output) bit rate. Compare this bit rate with the bit rate at the output of the Huffman encoder and comment on your observations.

• Average codeword length and the efficiency of the code.

• The rate at the output of the Huffman encoder in bits/s.

1.7 Mean Opinion Score (MOS) is often used for subjective evaluation of speech quality (intelligibility) 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

You may use in-built Hufmman code MATLAB functions to perform the following analysis.

Quantize and Huffman encode your message for 1, 2, 5, 6 and 8 bits quantizers. Listen to the quantized speech and Tabulate the MOS for each quantization level

From the average codeword length and resulting output bit rate of the Huffman encoder, also determine and tabulate the radio frequency bandwidth (W ) required to transmit the encoded message with 16-QAM modulation for each quantization level. Comment on the observations.

If at least a MOS of 3 is required and your channel is limited to a bandwidth of 12 kHz, recommend a suitable number of quantization levels. State any assumptions made.

1.8 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 frequency band. The null- to-null bandwidth of your modulated signal should not exceed the allocated 25 kHz. In this section you will test the suitability of quadrature phase shift keying (QPSK) to transmit the digital speech messages.

Set up your simulation to transmit the encoded message from Part 1 (L =16), with 128 samples (i.e. NumPts=128) for each transmitted symbol (each dibit).

2.1 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.2 Determine the number of bits and symbols you are going to transmit and store these as Nb and Nsym. If you have an odd number of transmitted bits you will need to append a dummy bit to the end of your transmission so that the binary message divides into an integer number of symbols.

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 the orthonormal basis functions Ψ1(t) and Ψ2(t). Show that they are orthonormal.

2.5 Convert the binary data to bipolar data and store as x. Reshape this vector so that x has one dibit per column.

2.6 Given a desired carrier amplitude of 1V, what is the transmitted symbol energy (Es) for your QPSK modulation scheme? Use this symbol energy to rescale the values stored in x so that the values of the first and second row will correspond to the symbol amplitudes (ai, bi) of your first and second basis functions (Ψ1(t), Ψ2(t)), respectively.

2.7 Oversample the first and second row of x so that each bit has NumPts samples per bit and store as a and b, respectively. This will generate rectangular pulses corresponding to the amplitudes of the basis functions and so a and b should be the same length as the basis functions.

2.8 Modulate the message with QPSK and store the modulated message as y. Plot the first 6 QPSK symbols of the transmitted signal.

2.9 Plot the spectrum of y. What is the null-to-null bandwidth of the signal and does is satisfy the channel restrictions? Could you suggest a change to the encoding scheme that might allow the main lobe of your signal to occupy the full width of the channel? What is the major issue in transmitting this signal given the channel constraints and is there anything that could be done to reduce this issue?

2.10 Assuming no channel distortions recover the bit sequence using a correlation receiver.1

The correlator receiver can be implemented using the reshape function. Recover the in-phase component of the received signal by multiplying by Ψ1(t) and reshape the product so that each column represents one symbol duration (with NumPts samples). Integrate over each symbol period and store the correlation as zi. Repeat this process for the quadrature-phase component of the signal.

2.11 Convert the received binary bipolar data back to binary format and recover the speech message using the Huffman decoder constructed in Part 1.

2.12 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.13 Simulate and plot the bit error rate performance of the above modulation in the Eb/N0

range 0dB to 12dB. Given:

snr [dB] = EbNo [dB] + 10*log10(k) + 10*log10(2) - 10*log10(NumPts)

Where k is the number of bits transmitted per symbol.

Compare the simulated error rate performance with the theoretical bit error rate per- formance of QPSK. Theoretical bit-error-rate probability of QPSK modulation is given by:

  Pb

Q ..2Eb Σ

0

2.14 Visualise the effect of AGWN on the output of the matched filter receiver by plotting zi

against zq on the IQ plane for four SNR conditions, when SNR = 0, 5, 10 and 12 dB.

2.15 Listen to the decoded speech for each Eb/N0 value simulated above and assess the speech quality according to the MOS defined in section 1. Assuming the minimum MOS required is 3, decide the minimum acceptable Eb/N0 required at the receiver.

Part 3  Performance of Multi-Level Modulation Schemes

Your client also wants you to analyse the transmission of live high quality security video feed using a wireless link. As video signals from number of security cameras are multiplexed before the transmission, the data rate of the wireless channel varies. The Queensland Government was able to secure a 10 MHz spectrum around 900 MHz range from the Australian Communications and Media Authority (ACMA). In this task you need to choose an appropriate digital modulation scheme to transmit the video feed with the given data rate using the allocated radio spectrum. For this analysis you will simulate the bit-error rate performance of a chosen M-QAM system in the baseband (no-carrier).

You can use built-in MATLAB functions for this task (useful MATLAB functions: qammod, awgn, scatterplot ) or any other appropriate function. Load A2BData.mat to obtain the data rate (bit rate), ChannelDataRate and the Roll-Off factor of the raised cosine filter, r, 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 modula- tion 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 105. Hint: You can use base-band simulation without the carrier. For based band simulation you need to use NumPts=1 to estimate the SNR using the equation in Part 2.13. .

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, 35dB and 50dB and comment on your observations.

6. If the maximum acceptable bit-error rate at the receiver is 105, calculate the minimum transmitted power required at the transmitter station. Use the following parameters of the wireless link,

• Transmit antenna gain = 5 dB and Receiver antenna gain = 30 dB

• Cable loss at the transmitter = 2 dB and Cable loss at the receiver = 2 dB

• Path-loss of the wireless link = 50 dB

• Noise power spectral density at the receiver = 1012 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 105 based on the modulation scheme you selected.]

7. Choose a modern communication system and describe how digital modulation is being used.

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.

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 prioritised. 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 R2019b 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.

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 Submission Check-list

Submission deadline is on the Sunday, 30th October 2022, 11:59 pm. If you are unable to

submit your solutions by this deadline, you can request an automatic 48 hour extension or a longer extension based on your circumstances. As per QUT policy, late assignments submitted without an approved extension 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)

• Main MATLAB code 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 22se2 Assessment Assignment 2B Assignment 2B: Submission.

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.

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.