Difference between revisions of "FM Homework Assignment Questions"
(→Question 14) |
(→Questions and Answers (Q&A)) |
||
(42 intermediate revisions by 11 users not shown) | |||
Line 1: | Line 1: | ||
==Introduction== | ==Introduction== | ||
− | Please feel free to use this page like a message board to ask any questions you like about the FM [[Comms IV Assignment|homework assignment]]. | + | Please feel free to use this page like a message board to ask any questions you like about the FM [[Comms IV Assignment|homework assignment]]. Anyone can reply to a question, even other students. |
− | + | ||
==Questions and Answers (Q&A)== | ==Questions and Answers (Q&A)== | ||
Line 27: | Line 26: | ||
How do we do complex numbers in Matlab? | How do we do complex numbers in Matlab? | ||
− | :'''Answer 3:''' You can enter and perform operations on complex numbers in Matlab very easily, just like real numbers. | + | :'''Answer 3:''' You can enter and perform operations on complex numbers in Matlab very easily, just like real numbers. You can use i or j to represent sqrt(-1). I suggest not using i or j as a variable in your code, as this could lead to confusion with sqrt(-1). So, as an example try entering the following to see how it works: |
:>> a = 1+2i | :>> a = 1+2i | ||
Line 60: | Line 59: | ||
but I don't quite get the meaning of the noise spectral density parameter on page 1 of the assignment. In particular the 10-30dB in steps of 1 dB part. Does the A^2 in that equation relate to the A parameter above it (1 V peak) or is it the amplitude of each individual noise sample? | but I don't quite get the meaning of the noise spectral density parameter on page 1 of the assignment. In particular the 10-30dB in steps of 1 dB part. Does the A^2 in that equation relate to the A parameter above it (1 V peak) or is it the amplitude of each individual noise sample? | ||
− | :'''Answer 7:''' | + | :'''Answer 7:''' It is important that you uniformly scale the whole 10 ms sequence, i.e. the maxima or the minima, whichever is greater in magnitude, because the 10 ms sequence determines the same scaling to be made for the whole sequence. |
===Question 8=== | ===Question 8=== | ||
Line 70: | Line 69: | ||
Do we use the frequency warping equation, substitute omega_d = 2 kHZ, find omega_a, substitute omega_a for omega_m in the H1(s) equation and *then* do the bilinear transformation on it? I ask because the frequency warping I'm doing in matlab doesn't seem to have any effect on the value of omega. Is that expected? | Do we use the frequency warping equation, substitute omega_d = 2 kHZ, find omega_a, substitute omega_a for omega_m in the H1(s) equation and *then* do the bilinear transformation on it? I ask because the frequency warping I'm doing in matlab doesn't seem to have any effect on the value of omega. Is that expected? | ||
− | :'''Answer 9:''' <blah blah> | + | :'''Answer 9:''' <blah blah> student awnser:(i'm not sure why he said blah, blah this is quite a clear question, yes solve the frequency warping first, then use the new value of omega_d and apply the first order buttersworth filter) |
===Question 10=== | ===Question 10=== | ||
− | I've got "divide by 0" error message when | + | I've got "divide by 0" error message when I trying to find lambda, given equation in Part 7. How to solve this problem in Matlab? |
− | :'''Answer 10:''' | + | :'''Answer 10:''' This isn't the type of question I can help with. Coding is a very personal thing. Just follow all the steps you have been taught for debugging code! You can display the content of arrays in Matlab and this can help you to track the source of the problem. |
===Question 11=== | ===Question 11=== | ||
Line 94: | Line 93: | ||
Is a late hand-in still acceptable and what is the penalty for it? | Is a late hand-in still acceptable and what is the penalty for it? | ||
− | :'''Answer 13:''' Fifty lashes of the whip and three months bread and water in solitary confinement in Guantanamo. Just kidding. But seriously don't be late. The late rules are not very friendly and can be found [[Comms_IV_Assignment#Marking|here]]. | + | :'''Answer 13:''' Fifty lashes of the whip and three months bread and water in solitary confinement in [http://en.wikipedia.org/wiki/Guantanamo_Bay_detention_camp Guantanamo]. Just kidding. But seriously don't be late. The late rules are not very friendly and can be found [[Comms_IV_Assignment#Marking|here]]. |
===Question 14=== | ===Question 14=== | ||
− | I am adjusting for frequency warping and then performing a bilinear transform to realise my digital filters. I am using the function "freqz" to plot the frequency responses of the digital filters. | + | I am adjusting for frequency warping and then performing a bilinear transform to realise my digital filters. I am using the function "freqz" to plot the frequency responses of the digital filters. When plotting the frequency responses, and looking at the 3dB frequency, it seems that I can be 5 Hz to 10 Hz off the desired frequency, depending on the filter. Is this an acceptable error? Or am i doing something horribly wrong? |
− | + | :'''Answer 14:''' The 3 dB freqs are in the order of kHz, so an error of 10 Hz is negligible! Don't worry. (If you had a 10 kHz error, now that would be a serious problem). | |
− | Is this | + | ===Question 15=== |
+ | I have filtered my random signal, and the frequency responses look correct, however when I look at my signal in the time domain, after passing through filter H1, the random signal losses over 80% of its power. Is this fine? | ||
− | :'''Answer | + | '''Answer 15:''' This result is to be entirely expected at this stage. However, you need not worry about having to work with such a small signal as in the last paragraph of Section 1 you are requested to “scale the filtered output so that it does not exceed the values +/- 1.” So this means that you will need to scale up your output so that it meets the requirement above. |
+ | |||
+ | ===Question 16=== | ||
+ | Do we need to submit a report? I could not find any mention of a report in the description of tasks required, but in the section of the assignment sheet about submission it says "As well as a hard copy, you must attach a CD pouch to your report and insert a CD of your whole project directory containing all the Matlab files, log files, Word files, pdf files, and any files relating to this assignment." I am a bit confused about this. | ||
+ | |||
+ | '''Answer 16:''' If you look carefully at the second paragraph of the Section 9 “Tasks to be Performed” in the last sentence there is a clear requirement for a report to be submitted for this assignment. It is effectively saying: “Present your work as a thorough investigative report and it is possible that you will do better than even if some of your analysis is wrong!” | ||
+ | |||
+ | ===Question 17=== | ||
+ | Which SNR equation do we use in Action 5? Is it SNR = mean(m^2(t)) / mean(s^2(t))? Thanks. | ||
+ | |||
+ | ===Question 18=== | ||
+ | The assignment submission requires that we submit a CD containing all our assignment files. But given that it is currently the year 2014 and I haven't used a CD in almost 5 years this is going to require me to go down to the local shops, buy a pack of 20 CDs (assuming they still sell them), throw the other 19 in the bin (seems a bit wasteful), then find a computer with a CD burner (do they still exist?) and then try and remember how to use it. So my question is, is there any chance of having an on-line submission system like almost every other course has? | ||
+ | |||
+ | '''Answer 18:''' The reason for asking for a CD or DVD is that it is flat, goes in a pouch and can be stapled to the report. You can use a USB as a last resort, but it is dangerous because it is hard to label and can get easily separated from your report. To avoid getting a pack of 20 CDs, you can get one free from our departmental store. | ||
+ | |||
+ | ===Question 19=== | ||
+ | I have run my initial simulation and my output is a very strange and I wondered if I am doing the noise spectral correct. | ||
+ | Would it be right to take a dB value and 10^(x/20) it and then rearrange pr/no*w to find no. this is then randn()*no*fs to create | ||
+ | the random additive noise. | ||
+ | |||
+ | '''Answer 19:''' The mathematics as you have stated here seems to be on the right track, but it should be 10^(x/10) and not 10^(x/20)as you need a power ratio. Other than that, you need to check carefully as to whether you have implemented it correctly in Matlab. | ||
+ | |||
+ | ===Question 20=== | ||
+ | Because we have 21 steps (from 10dB to 30dB), does this mean we find 21 values of No and Pr? Which then leads to 21 values of sigma (because we get sigma from No), which then leads to generating 21 signals of nc and ns (because nc = GRNG*sigma and ns = j*GRNG*sigma). This is my approach to it at the moment, would like to know if I'm on the right track. | ||
+ | |||
+ | '''Answer 20:''' The choice of the number of steps from 10 dB to 30 dB is purely arbitrary, the recommended number of about 20 is the minimum amount to get a decent curve. You can have more if you wish. Your approach seems ok. | ||
+ | |||
+ | ===Question 21=== | ||
+ | Our situation was that after incorporating the noise increase factor of 1.1530 into the theoretical SNR, our simulated SNR for the sine wave was exceeding the theoretical value by a small amount (0.15~0.3dB) after a certain threshold point (around 11.5dB of pre-detection SNR). The random signal's simulated SNR, | ||
+ | however, did not show this behaviour and remained below the theoretical value at all times as expected. | ||
+ | |||
+ | After a great number of simulations and checking intermediate working steps, we concluded that there could be two reasons for this effect: | ||
+ | |||
+ | :1. The noise increase factor of 1.1530 is only approximate and causes the theoretical SNR to drop a bit further than it actually should. | ||
+ | |||
+ | :2. Approximation of integrals by summations in modulating and demodulating cause the final result to change slightly. | ||
+ | |||
+ | I personally think it's the first reason that is throwing our results off. If you don't mind us asking, how is the noise increase factor | ||
+ | of 1.1530 calculated for a 5th order Butterworth filter and under what conditions is this accurate? | ||
+ | |||
+ | '''Answer 21:''' The increased noise output of 1.1530 times larger than with an ideal filter is associated with the practical implementation of the digital filter, not the waveform. To state a factor to five figures could hardly be regarded as approximate. If you started with the same code for each case and have edited to apply to each case, one possibility is you have missed some edits. Worth you checking the code. | ||
+ | |||
+ | ===Question 22=== | ||
+ | I have a question for the Comms IV assignment submission specific to Rule 1: "The top caption of every Matlab graph must contain your student ID and name." My partner and I so far, have gone by the rule that whoever produced a particular plot puts their own name in the top caption of each graph. So in my assignment, plots which I have produced have my name in the caption, the plots which he coded have his name in the caption. Is this ok? Am I reading that rule correctly, as depending on how you read it that rule could just mean in my submission I should only have my name on every plot. | ||
+ | |||
+ | '''Answer 22:''' Yes, you are correct. It is the name and ID of the student who did the code that should be on the plot. If you truly shared the development of the code then put both your names. | ||
+ | |||
+ | ===Question 23=== | ||
+ | I am very confused with the equation on top of page 1: Pr/NoW = (A^2)/2NoW = 10 dB to 30 dB in steps of 1 dB, what does this mean? | ||
+ | |||
+ | '''Answer 23:''' Going from 10 dB to 30 dB in steps of 1 dB means the assignment wants you to do it for 20 values for purposes of plotting graphs later. | ||
+ | This comes clear when you scroll down to the last page and read steps 5 and 7. Notice step 6 wants you to bother with only one specific value. | ||
+ | |||
+ | ===Question 24=== | ||
+ | How do I generate log files on Matlab? | ||
+ | |||
+ | ===Question 25=== | ||
+ | Hello all. I met a question on filter H4. When signal go through H4, it will lose power. So even the input signal doesn't contain noise part, the Lambda value cannot be 1 (what I got is 0.8782). In this case, the whole message signal cannot be filtered out completely from the output signal. Do you encounter a similar problem? | ||
+ | |||
+ | ===Question 26=== | ||
+ | Task 2 asks for signals for m(t), which i would assume are the sinewave and filtered random signal. | ||
+ | Task 3 asks for vref which seems to simply be m(t) as their is no added noise. | ||
+ | Are task 2 and task 3 identical? | ||
+ | |||
+ | ===Question 27=== | ||
+ | Hi, do you have a specific report template you want us to use to do the assignment report, or can we just freely write out the steps without any order? Do we code the assignment in MatLab from scratch without a skeleton structure? | ||
==Extra Advice== | ==Extra Advice== | ||
Line 112: | Line 177: | ||
* '''Using unwrap in Matlab.''' Make sure you are using unwrap correctly. Unwrap is designed to be used on an entire array at once, rather than inside a loop on a single value at a time. This is because the kth output of unwrap for the kth input value depends on the (k-1)th input etc. Note that most functions in mMtlab are designed so they have array inputs and array outputs. In many cases it makes no difference if you call a function one value at a time, or a whole array at once, e.g. the cos function. If you use unwrap within your demodulation loop on a single value at a time, the phase conversion will not work properly. So, you should have a line prior to your demodulation loop: Y = unwrap(angle(X)); %Y will be an array of the same size as X | * '''Using unwrap in Matlab.''' Make sure you are using unwrap correctly. Unwrap is designed to be used on an entire array at once, rather than inside a loop on a single value at a time. This is because the kth output of unwrap for the kth input value depends on the (k-1)th input etc. Note that most functions in mMtlab are designed so they have array inputs and array outputs. In many cases it makes no difference if you call a function one value at a time, or a whole array at once, e.g. the cos function. If you use unwrap within your demodulation loop on a single value at a time, the phase conversion will not work properly. So, you should have a line prior to your demodulation loop: Y = unwrap(angle(X)); %Y will be an array of the same size as X | ||
+ | |||
+ | |||
+ | |||
==See Also== | ==See Also== |
Latest revision as of 00:03, 20 March 2024
Contents
- 1 Introduction
- 2 Questions and Answers (Q&A)
- 2.1 Question 1
- 2.2 Question 2
- 2.3 Question 3
- 2.4 Question 4
- 2.5 Question 5
- 2.6 Question 6
- 2.7 Question 7
- 2.8 Question 8
- 2.9 Question 9
- 2.10 Question 10
- 2.11 Question 11
- 2.12 Question 12
- 2.13 Question 13
- 2.14 Question 14
- 2.15 Question 15
- 2.16 Question 16
- 2.17 Question 17
- 2.18 Question 18
- 2.19 Question 19
- 2.20 Question 20
- 2.21 Question 21
- 2.22 Question 22
- 2.23 Question 23
- 2.24 Question 24
- 2.25 Question 25
- 2.26 Question 26
- 2.27 Question 27
- 3 Extra Advice
- 4 See Also
- 5 Back
Introduction
Please feel free to use this page like a message board to ask any questions you like about the FM homework assignment. Anyone can reply to a question, even other students.
Questions and Answers (Q&A)
Question 1
I have been trying for days, using the bilinear transform (matlab: bilinear) to convert the filters from continuous time domain to discrete time domain. For the butterworth filter, I even used the Butterworth function provided by matlab (matlab: butter). Nothing worked, the frequency responses always showed a difference of about a factor of 10. I then stumbled across another discretisation method from the Control Systems Toolbox: c2d. For the first two filters, I simply used a bilinear tustin approximation ( Hn = c2d(Hn_a,ts,'tustin') ) and for the third filter, I used the bilinearm tustin approximation with prewarping, as with higher frequencies, the prewarping effect is more visible (H3=c2d(H3_a,ts,'prewarp',omega_c3)). The approximation using a zero order hold also works, but the prewarp is more accurate. My question now: Is it mandatory that we use the bilinear() function, or is the above described method okay?
- Answer 1: <blah blah>
Question 2
Is the equation for the reference signal at the top of page 3 of the assignment? (v(t) = ...) I'm trying to integrate to get phi(t) but the integral of the message signal is always zero.
- >> syms t;
- >> sin_m_of_t = sin(2*pi*2000*t);
- >> int(sin_m_of_t, 0, 277775)
- ans = 0
so that implies that for the sinusoidal input v(t) = A + n_c(t) + j*n_s(t)? It is just a sine wave though, so I suppose it does make sense that its integral over a whole number multiples of 2*pi is zero. Also, is my upper limit on the integral correct? ( = delta * (number of samples - 1))
- Answer 2: Like it says in the "Extra Advice" section, don't use symbolic variables. The assignment specifies an approximation for the integral using summation, this is the best way to get phi using Matlab. Think about what's going on here too and what the integral means.
Question 3
How do we do complex numbers in Matlab?
- Answer 3: You can enter and perform operations on complex numbers in Matlab very easily, just like real numbers. You can use i or j to represent sqrt(-1). I suggest not using i or j as a variable in your code, as this could lead to confusion with sqrt(-1). So, as an example try entering the following to see how it works:
- >> a = 1+2i
- >> b = 2+3j
- >> c = ones(10,1);
- >> d = a*c
- >> e = exp(i*c)
Question 4
The assignment seems a little ambiguous, as the specs just indicate that the maximum absolute value of the message signal must be less than 1.
- Answer 4: You are right. In fact, the random message signal should be normalised so that its maximum absolute value is always 1. Therefore please do this in your simulation.
Question 5
I am a little confused about which bilinear transform to use... is it "[numd,dend] = bilinear(num,den,fs)" if so i am not sure what the num and den parameters should be.
- Answer 5: <Answer is from student> If you open up the help menu in MATLAB (Help -> Product Help), search for the function 'bilinear'. Under the "Transfer Function" heading, there is an equation that describes exactly what num and den are.
Question 6
I'm having difficulty trying to set the seed of the Gaussian random number generator at the begginning of my simulation. I take it you need to declare a variable such that:
- >> seed = "some prime number";
...then go into the source block parameter for Random Number and change the inital seed parameter to "seed" and play around with seed values from your code as the assignment suggests (if you want to). But the problem I'm having is matlab won't let me change this parameter.. in fact I can't even change "mean" or "variance" not that I need but how can I gain access to change this?
- Answer 6: You can do it like that... or you can read the Matlab help on the function and find a much easier way to seed the generator. Mean and variance are easy to change after the values are generated, think about how you would map a normal distribution onto a standardised normal distribution with mean 0 and s.d. 1 in high school statistics, and reverse the process.
Question 7
What exactly is required when scaling noise phasors? At the moment I have two arrays called n_c and n_s filled with values matlab spits out of randn. From page 3 we know:
- sigma = sqrt(Noise spectral density * sampling frequency)
but I don't quite get the meaning of the noise spectral density parameter on page 1 of the assignment. In particular the 10-30dB in steps of 1 dB part. Does the A^2 in that equation relate to the A parameter above it (1 V peak) or is it the amplitude of each individual noise sample?
- Answer 7: It is important that you uniformly scale the whole 10 ms sequence, i.e. the maxima or the minima, whichever is greater in magnitude, because the 10 ms sequence determines the same scaling to be made for the whole sequence.
Question 8
The system actually has for filters, however you are only asking for plots of the first 3. Should we include plots of H4 as well?
- Answer 8: <Answer is from student> I believe H4(s) is identical to H2(s)
Question 9
Do we use the frequency warping equation, substitute omega_d = 2 kHZ, find omega_a, substitute omega_a for omega_m in the H1(s) equation and *then* do the bilinear transformation on it? I ask because the frequency warping I'm doing in matlab doesn't seem to have any effect on the value of omega. Is that expected?
- Answer 9: <blah blah> student awnser:(i'm not sure why he said blah, blah this is quite a clear question, yes solve the frequency warping first, then use the new value of omega_d and apply the first order buttersworth filter)
Question 10
I've got "divide by 0" error message when I trying to find lambda, given equation in Part 7. How to solve this problem in Matlab?
- Answer 10: This isn't the type of question I can help with. Coding is a very personal thing. Just follow all the steps you have been taught for debugging code! You can display the content of arrays in Matlab and this can help you to track the source of the problem.
Question 11
When we plot our s_o and n_o in task 6, it asks for us to plot from 0 < 10ms. As our s_o and n_o is discreet and there will be 100k samples I'm setting my x_max to be 10 00us(10ms)/fs = 3600. Is this representation intuitive enough or would you like some manipulation so that it read 10ms.
- Answer 11: <blah blah>
Question 12
I've gone to run my code in Matlab on the computers in em211 and it comes up with an error:
- ??? Undefined command/function 'bilinear'.
It was working fine yesterday in here and I haven't changed any code to do with the filters since. Would this be a problem with my code? My account? Something to do with Matlab in em211? I've tried multiple computers in here and they all give the same error. Will I expect to find the same error in CATS?
- Answer 12: <Answer is from a student> I am doing all my work in em211, and i haven't had a problem with the bilinear function. If you are still having a problem, i guess its best to talk to ITS or whoever is responsible for the em211 computer labs.
Question 13
Is a late hand-in still acceptable and what is the penalty for it?
- Answer 13: Fifty lashes of the whip and three months bread and water in solitary confinement in Guantanamo. Just kidding. But seriously don't be late. The late rules are not very friendly and can be found here.
Question 14
I am adjusting for frequency warping and then performing a bilinear transform to realise my digital filters. I am using the function "freqz" to plot the frequency responses of the digital filters. When plotting the frequency responses, and looking at the 3dB frequency, it seems that I can be 5 Hz to 10 Hz off the desired frequency, depending on the filter. Is this an acceptable error? Or am i doing something horribly wrong?
- Answer 14: The 3 dB freqs are in the order of kHz, so an error of 10 Hz is negligible! Don't worry. (If you had a 10 kHz error, now that would be a serious problem).
Question 15
I have filtered my random signal, and the frequency responses look correct, however when I look at my signal in the time domain, after passing through filter H1, the random signal losses over 80% of its power. Is this fine?
Answer 15: This result is to be entirely expected at this stage. However, you need not worry about having to work with such a small signal as in the last paragraph of Section 1 you are requested to “scale the filtered output so that it does not exceed the values +/- 1.” So this means that you will need to scale up your output so that it meets the requirement above.
Question 16
Do we need to submit a report? I could not find any mention of a report in the description of tasks required, but in the section of the assignment sheet about submission it says "As well as a hard copy, you must attach a CD pouch to your report and insert a CD of your whole project directory containing all the Matlab files, log files, Word files, pdf files, and any files relating to this assignment." I am a bit confused about this.
Answer 16: If you look carefully at the second paragraph of the Section 9 “Tasks to be Performed” in the last sentence there is a clear requirement for a report to be submitted for this assignment. It is effectively saying: “Present your work as a thorough investigative report and it is possible that you will do better than even if some of your analysis is wrong!”
Question 17
Which SNR equation do we use in Action 5? Is it SNR = mean(m^2(t)) / mean(s^2(t))? Thanks.
Question 18
The assignment submission requires that we submit a CD containing all our assignment files. But given that it is currently the year 2014 and I haven't used a CD in almost 5 years this is going to require me to go down to the local shops, buy a pack of 20 CDs (assuming they still sell them), throw the other 19 in the bin (seems a bit wasteful), then find a computer with a CD burner (do they still exist?) and then try and remember how to use it. So my question is, is there any chance of having an on-line submission system like almost every other course has?
Answer 18: The reason for asking for a CD or DVD is that it is flat, goes in a pouch and can be stapled to the report. You can use a USB as a last resort, but it is dangerous because it is hard to label and can get easily separated from your report. To avoid getting a pack of 20 CDs, you can get one free from our departmental store.
Question 19
I have run my initial simulation and my output is a very strange and I wondered if I am doing the noise spectral correct. Would it be right to take a dB value and 10^(x/20) it and then rearrange pr/no*w to find no. this is then randn()*no*fs to create the random additive noise.
Answer 19: The mathematics as you have stated here seems to be on the right track, but it should be 10^(x/10) and not 10^(x/20)as you need a power ratio. Other than that, you need to check carefully as to whether you have implemented it correctly in Matlab.
Question 20
Because we have 21 steps (from 10dB to 30dB), does this mean we find 21 values of No and Pr? Which then leads to 21 values of sigma (because we get sigma from No), which then leads to generating 21 signals of nc and ns (because nc = GRNG*sigma and ns = j*GRNG*sigma). This is my approach to it at the moment, would like to know if I'm on the right track.
Answer 20: The choice of the number of steps from 10 dB to 30 dB is purely arbitrary, the recommended number of about 20 is the minimum amount to get a decent curve. You can have more if you wish. Your approach seems ok.
Question 21
Our situation was that after incorporating the noise increase factor of 1.1530 into the theoretical SNR, our simulated SNR for the sine wave was exceeding the theoretical value by a small amount (0.15~0.3dB) after a certain threshold point (around 11.5dB of pre-detection SNR). The random signal's simulated SNR, however, did not show this behaviour and remained below the theoretical value at all times as expected.
After a great number of simulations and checking intermediate working steps, we concluded that there could be two reasons for this effect:
- 1. The noise increase factor of 1.1530 is only approximate and causes the theoretical SNR to drop a bit further than it actually should.
- 2. Approximation of integrals by summations in modulating and demodulating cause the final result to change slightly.
I personally think it's the first reason that is throwing our results off. If you don't mind us asking, how is the noise increase factor of 1.1530 calculated for a 5th order Butterworth filter and under what conditions is this accurate?
Answer 21: The increased noise output of 1.1530 times larger than with an ideal filter is associated with the practical implementation of the digital filter, not the waveform. To state a factor to five figures could hardly be regarded as approximate. If you started with the same code for each case and have edited to apply to each case, one possibility is you have missed some edits. Worth you checking the code.
Question 22
I have a question for the Comms IV assignment submission specific to Rule 1: "The top caption of every Matlab graph must contain your student ID and name." My partner and I so far, have gone by the rule that whoever produced a particular plot puts their own name in the top caption of each graph. So in my assignment, plots which I have produced have my name in the caption, the plots which he coded have his name in the caption. Is this ok? Am I reading that rule correctly, as depending on how you read it that rule could just mean in my submission I should only have my name on every plot.
Answer 22: Yes, you are correct. It is the name and ID of the student who did the code that should be on the plot. If you truly shared the development of the code then put both your names.
Question 23
I am very confused with the equation on top of page 1: Pr/NoW = (A^2)/2NoW = 10 dB to 30 dB in steps of 1 dB, what does this mean?
Answer 23: Going from 10 dB to 30 dB in steps of 1 dB means the assignment wants you to do it for 20 values for purposes of plotting graphs later. This comes clear when you scroll down to the last page and read steps 5 and 7. Notice step 6 wants you to bother with only one specific value.
Question 24
How do I generate log files on Matlab?
Question 25
Hello all. I met a question on filter H4. When signal go through H4, it will lose power. So even the input signal doesn't contain noise part, the Lambda value cannot be 1 (what I got is 0.8782). In this case, the whole message signal cannot be filtered out completely from the output signal. Do you encounter a similar problem?
Question 26
Task 2 asks for signals for m(t), which i would assume are the sinewave and filtered random signal. Task 3 asks for vref which seems to simply be m(t) as their is no added noise. Are task 2 and task 3 identical?
Question 27
Hi, do you have a specific report template you want us to use to do the assignment report, or can we just freely write out the steps without any order? Do we code the assignment in MatLab from scratch without a skeleton structure?
Extra Advice
- Do not use symbolic variables in matlab for the assignment! You should only use symbolic variables in Matlab when you want to simplify an algebraic mathematical expression, such as factorising a polynomial, or finding the mathematical integral or derivative. This is usually not helpful for a simulation. In a simulation you should be using arrays of numbers. These numbers can either be real or complex. All integration and differentiation should be done numerically, e.g. we approximate integration by summing. Summing should be done just as if you were programming in some other language like C, i.e. use a loop. Differentiation is approximated by taking differences. Again, this is likely to be done in a loop.
- Plotting graphs. It is ok to have your signal and noise traces on the same plot, provided they are easy to see after printing in order to save paper. That is plot each trace in a different colour, or in different line styles. However, for demonstrating, at the least I would like to see 3 filter plots, 2 signal/noise plots (with no more than two traces each) and 2 SNR plots. Further to this, 4-5 exploratory plots of your own to demonstrate ownership of the assignment is sufficient.
- Using unwrap in Matlab. Make sure you are using unwrap correctly. Unwrap is designed to be used on an entire array at once, rather than inside a loop on a single value at a time. This is because the kth output of unwrap for the kth input value depends on the (k-1)th input etc. Note that most functions in mMtlab are designed so they have array inputs and array outputs. In many cases it makes no difference if you call a function one value at a time, or a whole array at once, e.g. the cos function. If you use unwrap within your demodulation loop on a single value at a time, the phase conversion will not work properly. So, you should have a line prior to your demodulation loop: Y = unwrap(angle(X)); %Y will be an array of the same size as X