PLEASE DO THE ASSIGNMENT URGENTLY
Laboratory Assignment: Programming for Engineers / Laboratory Assignment (Refer / Defer): Marvin the Paranoid Android Laboratory Assignment: Why is Marvin Complaining? Introduction The purpose of this assignment is to encourage an increase in the awareness of the uses of programming in engineering in the reader, an awareness centred on tackling a complex problem found in a typical signal collection domain. The high-level language to be used for this assignment is the C++ programming language and the use of the procedural or object-oriented C++ approach is allowed. Aims: · Increase an awareness of the uses of programming in engineering, along with a typical computer interface; · Develop skills in algorithm design and in the application of a high-level computer language to implement such a design; · Understand a typical software methodology used in industry. Hence, after successful completion of this assignment, the reader will be able to: · Recognise and classify a variety of computer system interfaces and how they are used, specifically in signal collection for this instance; · Analyse the requirements of a system and develop an algorithm to meet the requirement of signal collection and parsing of a transmitted signal; · Implement an algorithm in procedural / object C++; · Develop a test schedule to confirm the correct operation of a computer program. The exercise can be completed using the Visual Studio 2017 (Community Edition) under your Windows account. Other development environments that can achieve the same outcome are acceptable. Maximum marks in various sections are given throughout. All data and information relating to this exercise can be found on the course page on the Portal. Relevant files: · All program examples developed so far completed in the laboratory sessions. It is assumed that these source files have been saved to a secure area; · main.cpp with unlimited.h, binfileread.cpp, decode.cpp and moments.cpp; · Binary files: · marvin_20wpm.bin and marvin_20wpm_short.bin · marvin_10wpm.bin and marvin_10wpm_short.bin · marvin_5wpm.bin and marvin_5wpm_short.bin Overview The middle of the last century saw an increase in the way information was broadcast and received as well as the variety of methods that this information was modulated on to a simple carrier. Clearly, the carrier was of much higher frequency that the main component of the information (for example, speech ranges from 300Hz to about 4.5kHz) since you needed the additional energy in order for this information to go over large distances. A very simple way of broadcasting information was Morse code. Initially it was transmitted at the audio range over a fixed wire (a single tone, “On” or “Off”, to represent the alphanumeric information) but its specific alphabet was constructed from “dits” and “dahs” (say, 50ms for a dit, but three times longer for a dah). This alphabet also had durations when the tone was off to represent and inter-element space (IES), and inter-character space (ICS), or an inter-word space (IWS) – typically, 50ms, 150ms, 250 – 350ms, respectively. This is all very well when you have a human at the other end of the broadcast that can decode the information from the phrasing of the language, but very rarely did this person write down their interpretation of the letter from its unique combination of dits and dahs. And there’s the issue: decoding a Morse signal traditionally required a human. Consider that you need to find a method of automatically decoding the information into a set of letters that may still need to be parsed out (or translated) to some readable form. As far as you are concerned: · Recognition. The signal has already been recognised as Morse from a wide range of analogue type of signals (for example, Phase Shift Keying (PSK) where this can use 2, 4, 8, 16, or more phases in the cycle of a carrier to help increase the available capacity of the signal). You know that you are receiving a tone in the high frequency spectrum that is clearly Morse and you would not be able to go any further in retrieving this information until you had a high level of confidence in knowledge of the type of carrier; · Demodulation. The signal has now been demodulated down to the audio range and this would usually be between 600 to 800Hz, the most sensitive part of the audio spectrum with our hearing. (This was usually done by the Morse listener manually tuning in their receiver to the broadcast carrier and the equipment would output the signal in the hearing range, in a similar fashion to the way AM works.) · Decoding. You can hear a signal that contains a number and mixed combination of dits and dahs. However, since this signal has been stored on a workstation, it will have been sampled with a frequency in order that there is limited risk of aliasing. Hence, you may find that the signal was sampled at 10kHz or even higher. 10kHz means 10,000 samples for every second’s worth of data and a typical line of speech, “How are you today?” may last for a few seconds. This is a lot of data to handle and you simply cannot view all of this data via a command window on the workstation. You need to have a way of managing the data that will be part of an algorithm in a program. The timing in the information when a Morse signal was broadcast was never guaranteed – it was person tapping, or using a paddle, in order to generate the dits and dahs. If you cannot get a guarantee of the timings, how can you design an algorithm that needs to demodulate the information and indicate dit, dah, IES, ICS, or IWS? You may also be surprised to know that Morse was an internationally recognised signal until around the year 2000. Even today, there are a considerable number of amateur radio users that still communicate using Morse. For the purpose of this assignment, the signal has been automatically generated and the timings will be guaranteed. Hence, your algorithm to find out the information in the signal should be fairly straightforward and, more importantly, there is never just one solution to a problem. You will be designing and implementing classes in to a framework program that will bring out the information in the signal – it does not matter how you do this, how many functions / classes you use, the algorithms employed, as long as you can assure me that your program guarantees to bring out the information in the signal. Here, you should also think about how you will verify your algorithm, perhaps even get it validated. Check out http://www.stottlerhenke.com/papers/IITSEC-09-assessing-perceived-truth-vs-ground-truth-in-aar.pdf . The point here is, just because you receive a series of letters that seem to give the correct answer that does not necessarily mean that this is the information that was broadcast – a Morse reader never assumed part of a word if they were never sure and they used a “.” as a substitute for a letter. For example, say the signal was noisy for a short time and the Morse listener has trouble with what he/she could hear (broadcasted in five-letter blocks): TODAYISTHE…THTIMETHISHA SBEENDONE Did the broadcaster mean the ninth or tenth time, or even something else? It was not the listener’s job to interpret (parse) information. So, and in a program that will do this for us, we need to ensure that it will give the correct output even if it is under a limited range of conditions (limited SNR, for example) and let the intelligence officer determine the context of the message. Signals that get received will not say what they are and you have to able to trust your algorithm to give you the correct output for data that will be unknown to anyone else apart from the broadcaster. It is up to you, the systems developer, to design an algorithm that can be trusted. Tasks: 1. Introduce the Task; Create a Project/Namespace in Visual Studio C++ Use the main.cpp, unlimited.h, and binaryfileread.cpp files in order to build a suitable executable. Test the executable at the command line by using the data files supplied (marvin_20wpm.bin and / or marvin_20wpm_short.bin - only 8,750 samples long (1.094 seconds)). The *_short.bin file is supplied for your convenience when developing your code. In this assignment you are expected to provide data from a file, rather than from the keyboard (STDIN) or as an array of double’s declared and initialised / assigned in a function. Generally, and run via a command window: ..\ProjectName\debug\ProjectName.exe filename.bin Figure 6 illustrates a specific use of running the program with a second, command-line variable (via argv[1] as an input variable in main(); thirty samples only). The marvin file contains the sampled values of a Morse code signal of an expression from the Hitchhiker’s Guide to the Galaxy. Figure 1 shows the extract of the marvin signal as plotted in MATLAB. ‘h’ ‘i’ Figure 1:The First Few dit’s and dah’s in the Audio (Binary Form) File Note that the data is stored in binary format from ASCII text. Figure 2:Zoomed-In View of the Start of the Signal Figure 2 shows a view from zooming in and, here, I have over-plotted with red stars to show where the data samples are. From inspection, you can deduce that a considerable number of samples have been used to represent a simple alphabet: the tone is either on or off. It’s on for time periods that represent a dit, a dah, and off for an IES, ICS, and IWS. To hear a dit at this kind of Baud rate, the tone does not have to be on very long and 200ms would not be unreasonable. But, for the timings of the other time periods, typically: · A ‘dah’ is three times longer than a ‘dit’; · An IES is the same length of time as a ‘dit’; · An ICS is three times longer than and IES/’dit’; · An IWS is five to seven times longer than an IES/’dit’; On this understanding that this is a simple signal (ASK-1), you can now assume that a considerable amount of the data is redundant when it comes to finding the information. You could use a statistical technique to find an average of the signal level over several samples: why represent 200ms of information with 1600 samples if you know that, at that particular point, it is on? From here, you should be able to use a technique to reduce the number of samples you have with a smaller number set and to still have a reasonably accurate representation of the signal. Note that the program expects a binary file for it to open and use functions and classes on the data. You can run the executable inside the Visual Studio Environment, but you do need