Serial port is most common way of communication, we can send or receive data using serial port. Normally, in engineering projects there's a need to send or receive data from microcontrollers to computer and in such projects, we used serial communication as its easy and quite quick in communication.
tep=serial('COM1', 'BaudRate', 9600); fopen(tep); fprintf(tep,'a'); fclose(tep);
- Code 1:
clc clear all close all disp(' Welcome to TEP!!!'); disp(' '); disp(' www.TheEngineeringProjects.com'); disp(' '); tep=serial('COM1'); % assign serial port object set(tep, 'BaudRate', 9600); % set BaudRate to 9600 set(tep, 'Parity', 'none'); % set Parity Bit to None set(tep, 'DataBits', 8); % set DataBits to 8 set(tep, 'StopBit', 1); % set StopBit to 1 %display the properties of serial port object in MATLAB Window disp(get(tep,{'Type','Name','Port','BaudRate','Parity','DataBits','StopBits'})); fopen(tep); % Open Serial Port Object fprintf(tep,'a'); %Print character 'a' to the serial port disp('Charater sent to Serial Port is "a".'); fclose(tep); %Close Serial Port Object
- Code 2:
clc clear all close all disp(' Welcome to TEP!!!'); disp(' '); disp(' www.TheEngineeringProjects.com'); disp(' '); tep=serial('COM1'); % assign serial port object set(tep, 'BaudRate', 9600); % set BaudRate to 9600 set(tep, 'Parity', 'none'); % set Parity Bit to None set(tep, 'DataBits', 8); % set DataBits to 8 set(tep, 'StopBit', 1); % set StopBit to 1 %display the properties of serial port object in MATLAB Window disp(get(tep,{'Type','Name','Port','BaudRate','Parity','DataBits','StopBits'})); fopen(tep); % Open Serial Port Object data = input('Enter character: ', 's'); %Ask user to Enter character fprintf(tep,data); %Print character 'a' to the serial port disp('Charater sent to Serial Port is:'); disp(data); fclose(tep); %Close Serial Port Object
- Code 3:
In today's post we are gonna implement few complex logical gates. Its not gonna be much difficult if you have the basic concepts. I am just pointing out few important points here. While implementing any gate in ladder logic, always consider rung as an electrical line having HIGH voltage at one end and LOW voltage at the other, while the inputs are simple switches. Voltage will be supplied to the output only when switch is closed i.e. input is HIGH, otherwise the output will remain OFF. You should also have a look at Introduction to Logic Gates.
You have seen in previous post, while implementing OR gate we have used a second switch in parallel which ends at the first rung so overall its a single rung having two inputs in parallel so input can come either from first switch or from second one. So, now let's start implementing some complex logical gates in Ladder Logic for PLC. Today, we are gonna implement these logic gates:
Ladder Logic is different from the usual programming language of Microcontrollers like Arduino, PIC Microcontroller etc. Microcontrollers programming usually compiled from top to bottom i.e. the compiler first capture the first statement and then moves downward till it reaches the end line but that's not the case with Ladder Logic Programming for PLC. In ladder logic, the compiler moves from left to right and it gets all the lines at the same time. It seems bit difficult to understand at first but be with me and you will get it at the end. :)
Ladder Logic is a programming language used for PLC as C for Microcontrollers. Ladder logic is a combination of rungs. Each rung is executed from left to right. For example, have a look at the below figure, a single rung of ladder logic is shown in it.
Today. I am gonna give an overview about PLC. We will have a look on basics i.e. what is PLC? Why we use PLC instead of microcontroller like Arduino or PIC Microcontroller? What's its advantages and disadvantages? I will try to cover all about the basics. After reading this tutorial, you must have a look at Introduction to Ladder Logic for P L C, Ladder Logic is programming language for PLCs.
There are different types of PLCs available in the market manufactured by different companies, so its impossible to cover all of them. In this tutorial, I am gonna discuss Fatek PLC as I have worked on it during my project. The model I have used is Fatek PLC Fbs-20MA. The reason I used this model because it was cheap and has enough input/output ports sufficient for my project. That's why I preferred it as its engineers' task to optimize the cost as well. Let's get started with PLC.
Its a basic question, which is normally asked by all the starters so I am gonna reply it first for the newbies.
What's inside PLC, which makes it so cool ? That's a good question and normally engineers wonder about it. PLC can be divided into 3 sections, which are as follows:
I think now you have the idea about PLC, so now I am getting started with PLC. I am gonna explain the functioning of Fatek PLC as I have used that one but if you are using another model of PC then no need to panic as all PLCs have same functionality. So, it doesn't matter which one you are using. If you check the below image then you will see I have marked three sections in it.
In the below image, I have indicated Section 4 and 5, these are the input/ output section. If you have a look at it closely then you can see there are two rows of screws, where you plug your wires for inputs and outputs and above them, they are also labelled with white color. So, it goes like that, first row of labelling is for first row of screws and second row is for second row of screws.
That's all for today. I hope you got the basic idea of Programmable logic controller and now its time to have a look at Introduction to Ladder Logic for P L C, ladder logic is programming language for PLC. Your feedback are warmly welcome. In the next tutorial, I am gonna cover about ladder logic and will show you how to program a PLC. Till then Take care and have fun.
An inverter, also named a power inverter, is an electrical power device that is used to convert direct current (DC) into alternating current (AC). Using a few control circuits and switches, one can get AC at any required voltage and frequency. Inverter plays exactly the opposite role of rectifiers as rectifiers are used for converting alternating current (AC) into direct current (DC). There are different types of inverters available these days. You should also have a look at Pure Sine wave Inverter Design with code and Modified Sine Wave Inverter Design with code. I think you are gonna like that one. Few most commonly used inverter types are:
First, take the case of a two-level inverter. A two-level Inverter creates two different voltages for the load i.e. suppose we are providing Vdc as an input to a two-level inverter then it will provide + Vdc/2 and – Vdc/2 on output. In order to build an AC voltage, these two newly generated voltages are usually switched. For switching mostly PWM is used as shown in Figure 2.1, reference wave is shown in the dashed blue line. Although this method of creating AC is effective but it has few drawbacks as it creates harmonic distortions in the output voltage and also has a high dv/dt as compared to that of a multilevel inverter. Normally this method works but in few applications, it creates problems particularly those where low distortion in the output voltage is required.
The concept of multilevel Inverter (MLI) is a kind of modification of a two-level inverter. In multilevel inverters we don’t deal with the two-level voltage instead in order to create a smoother stepped output waveform, more than two voltage levels are combined together and the output waveform obtained in this case has lower dv/dt and also lower harmonic distortions. The smoothness of the waveform is proportional to the voltage levels, as we increase the voltage level the waveform becomes smoother but the complexity of the controller circuit and components also increases along with the increased levels. The waveform for the three, five and seven level inverters are shown in the below figure, where we clearly see that as the levels are increasing, the waveform becoming smoother.
There are several topologies of multilevel inverters available. The difference lies in the mechanism of switching and the source of input voltage to the multilevel inverters. Three most commonly used multilevel inverter topologies are:
This inverter uses several H-bridge inverters connected in series to provide a sinusoidal output voltage. Each cell contains one H-bridge and the output voltage generated by this multilevel inverter is actually the sum of all the voltages generated by each cell i.e. if there are k cells in an H-bridge multilevel inverter then a number of output voltage levels will be 2k+1. This type of inverter has an advantage over the other two as it requires fewer components as compared to the other two types of inverters and so its overall weight and price are also less. Below Figure shows a k level cascaded H-bridge inverter.
In a single-phase inverter, each phase is connected to a single dc source. Each level generates three voltages which are positive, negative and zero. This can be obtained by connecting the AC source with the DC output and then using different combinations of the four switches. The inverter will remain ON when two switches with opposite positions will remain ON. It will turn OFF when all the inverters switch ON or OFF. To minimize the total harmonic distortion, switching angles are defined and implemented. The calculations for the measurement of switching angle will remain the same. This inventor can be categorized further into the following types:
In 5 level cascaded H Bridge Multilevel Inverters, Two H Bridge Inverters are cascaded. It has 5 levels of output and uses 8 switching devices to control whereas in 9 level cascaded H Bridge Multilevel Inverters, Four H Bridge Invertors are cascaded. It has 9 output levels and use and use 16 switching devices.
Cascaded H Bridge Multilevel Inverters are mostly used for static var applications i.e., in renewable resources’ of energy and battery based applications. Cascaded H Bridge Multilevel Inverters can be applied as a delta or wye form. This can be understood by looking at the work done by Peng where he used an electrical system parallel with a Cascade H Bridge. Here inverter is being controlled by regulating the power factor. Best application is when we used as photovoltaic cell or fuel cell. This is the example of Parallel connectivity of the H Bridge Multilevel Inverter.
H Bridge can also be used in car batteries to run the electrical components of the car. Also, this can be used in the electrical braking systems of the vehicles.
Scientists and engineers have also proposed the multiplicative factor on Cascade H Bridge Multilevel. It means that rather than using a dc voltage with the difference in levels, it uses a multiplying factor between different levels of the multilevel i.e., every level is a multiplying factor of the previous one.
Diode clamped multilevel inverters use clamping diodes in order to limit the voltage stress of power devices. It was first proposed in 1981 by Nabae, Takashi and Akagi and it is also known as a neutral point converter. A k level diode clamped inverter needs (2k – 2) switching devices, (k – 1) input voltage source and (k – 1) (k – 2) diodes in order to operate. Vdc is the voltage present across each diode and the switch. Single-phase diode clamped multilevel inverter is shown in the figure below:
The concept of diode clamped inverter can better be understood by looking into a three-phase six-level diode clamped inverter. Here the common dc bus is shared by all the phases, use five capacitors and six levels. Each capacitor has a voltage of Vdc and same is the voltage limit of switching devices. One important fact should be noted while considering the diode clamped inverter is that five switches will remain ON at any time. Six level, three-phase dc clamped multilevel inverter is shown in the figure below.
Outputs of each phase can be understood by the following table. Here reference voltage is the negative Vo. Condition 0 means switch is OFF and vice versa. Output waveforms of six level dc clamped inverter is shown below:
The most common application of diode clamped multilevel inverter is when a high voltage Dc and Ac transmission lines are interfaced. This can also be used in variable speed control of high power drives. Static variable compensation is also an application of diode clamped multilevel inverters.
The configuration of this inverter topology is quite similar to previous one except the difference that here flying capacitors is used in order to limit the voltage instead of diodes. The input DC voltages are divided by the capacitors here. The voltage over each capacitor and each switch is Vdc. A k level flying capacitor inverter with (2k – 2) switches will use (k – 1) number of capacitors in order to operate. The figure below shows a five-level flying capacitor multilevel inverter.
If we compare above figures, it shows that the number of switches, main diodes and DC-bus capacitors are same in both the cases. The only difference between the two topologies is that the previous one uses clamping diodes in order to limit the voltage while this topology uses flying capacitors for this purpose, and as capacitors are incapable of blocking the reverse voltage, which diodes do, the number of switches also increases. Voltage on each capacitor is differing from the next as it has a ladder structure. Voltage difference between two back to back capacitors determines the voltage in the output frame.
This post is the next part of our previous post Financial Calculations in MATLAB named as Implementation of Black Litterman Approach in MATLAB, so if you haven't read that then you can't understand what's going on here so, its better that you should first have a look at that post. Moreover, as this code is designed after a lot of our team effort so its not free but we have placed a very small cost of $20. So you can buy it easily by clicking on the above button.In the previous post, we have covered five steps in which we first get the financial stock data, then converted it to common currency and after that we calculated the expected returns and covariance matrix and then plot the frontiers with and without risk free rate of 3%. Now in this post, we are gonna calculate the optimal asset allocation, average return after the back test, calculation of alphas and betas of the system and finally the implementation of black-litterman approach. First five steps are explained in the previous tutorial and the next four steps for Implementation of Black Litterman Approach in MATLAB are gonna discuss in this tutorial, which are as follows:
You may also like to read:
In this part of the problem,I calculated the optimal asset allocation in the different years by choosing a constant required return. I chose the constant required return equal to 0.01 and used the highest_slope_portfolio function and plot the graphs. The code used in MATLAB is shown in the below:
ConsRet=0.010 for w=1:10 [xoptCR(:,w), muoptCR(w), sigoptCR(w)] = highest_slope_portfolio( covmat{1,w}, ConsRet , estReturn(w,:)', stdRet(w,:) ); End
The result for this part is shown in the Figure 3. For a constant required return of 0.01, portfolio turnover for each year has increased approximately by 2%.
In this part of the assignment, it was asked to perform a back test for the optimized portfolios and calculate the average return and the standard deviation for this portfolio. Average return is the average of expected return for the corresponding year and it is calculated by the below code in MATLAB, where w is varying from 1 to 10 to calculate for all the 10 years.
BTreturn(w,:)=estReturn(w,:)*xoptCR(:,w);Results obtained after the back test for the optimized portfolios for average return are shown in table3 below:
Average Return after the back test | |
1st year | 0.1158 |
2nd year | 0.0889 |
3rd year | 0.0797 |
4th year | 0.0628 |
5th year | -0.0660 |
6th year | -0.4323 |
7th year | -5.1212 |
8th year | -0.6820 |
9th year | 0.2891 |
10th year | 0.1691 |
Table : Average return after the back test
The standard deviation of the rate of return is a measure of risk. It is defined as the square root of the variance, which in turn is the expected value of the squared deviations from the expected return. The higher the volatility in outcomes, the higher will be the average value of these squared deviations. Therefore, variance and standard deviation measure the uncertainty of outcomes. Symbolically,
BTstd(w,:)=sqrt(stdRet(w,:).^2*(xoptCR(:,w).^2));The results of standard deviation for the 10 years are as follows:
Standard Deviation after the back test | |
1st year | 0.2942 |
2nd year | 0.1833 |
3rd year | 0.1799 |
4th year | 0.1733 |
5th year | 0.4026 |
6th year | 1.5834 |
7th year | 16.1279 |
8th year | 2.1722 |
9th year | 1.0430 |
10th year | 0.4949 |
FTLC= hist_stock_data('01111993','01112013','^FTLC','frequency','m'); LRFTLC=diff(log(FTLC.Close));After that I calculated the expected return of one unit of each asset based on the model which gave me the total covariance matrix for the single and multi indexed model. Finally, I calculated the alpha and beta for the model. The MATLAB code used for performing these actions is shown below:
for i = 1:7 mdl_si{i} = LinearModel.fit(LRFTLC, logRet(:,i), 'linear'); mdl_ret_s(i) = mdl_si{i}.Coefficients.Estimate(1:2)' * [1; 12*mean(LRFTLC)]; mdl_cov_s(i) = mdl_si{i}.RMSE^2; alpha_s = [mdl_si{i}.Coefficients.Estimate(1), alpha_s]; beta_s = [mdl_si{i}.Coefficients.Estimate(2), beta_s]; endAs a result, alphas and betas of the system are obtained which are shown in the table below:
Aplha | Beta |
0.0068 | 0.1748 |
0.0057 | 0.0335 |
0.0050 | 0.0528 |
0.0063 | 0.0552 |
0.0030 | 0.0249 |
0.0035 | 0.0083 |
0.0047 | 0.0289 |
Table: Alpha & beta of the model
In this part, I have finally implemented the Black Litterman approach on the data available. Black Litterman approach involves the below steps:
Few MATLAB Projects:
gamma = 1.9; tau = .3; for w=1:10 ind=[(w-1)*12+1 (w+10)*12]; logRet2=logRet(ind(1):ind(2),:); for i=1:7 OplogRet(:,i)=logRet2(i,:).*xoptCR(i,w)'*100; end covmatOP{1,w}=12*cov(OplogRet); end for w=1:10 Opweig(:,w)=xoptCR(:,w); Pi{w}= gamma *covmatOP{1,w}* Opweig(:,w); end figure for w=1:10 title('BL'); hold on; bar(Pi{w}) hold on; endThat's all for today, hope it will help you all in some way. If you have any questions then ask in comments and I will try my best to resolve them.
After that I calculated Expected Returns & Covariance Matrix for all these data for the last 10 years and finally plot them. Moreover, I have also plotted the frontiers with risk free rate of 3% so that the ideal and realistic conditions can be compared. So, here are the overall steps we are gonna cover in this project:
You may also like to read:
Stocks = hist_stock_data('X', 'Y', 'Z', 'frequency', 'm')
snp500 = hist_stock_data('01111993','01112013','^GSPC','frequency','m'); NDX=hist_stock_data('01111993','01112013','^NDX','frequency','m'); GSPTSE=hist_stock_data('01111993','01112013','^GSPTSE','frequency','m'); DAX = hist_stock_data('01111993','01112013','^GDAXI','frequency','m'); CAC40=hist_stock_data('01111993','01112013','^FCHI','frequency','m'); FTAS=hist_stock_data('01111993','01112013','^FTAS','frequency','m'); SSMI=hist_stock_data('01111993','01112013','^SSMI','frequency','m');
The first two values were in US dollars, while third one was in CAD dollars, fourth and fifth values were in Euros, sixth were in GBP and the last one was in Swiss France. Hence, there was a need to convert all these currencies into one currency as instructed. I converted all of them into US dollars. In order to convert them, I first defined the exchange rate between these currencies and the US dollars using the below code:
GBP2USD=1.6; EURO2USD=1.34; CAD2USD=0.95; SF2USD=1.08;After defining the exchange rate, I applied it to all the currencies using the below code:
GSPTSE=CurrencyConvert(GSPTSE, CAD2USD); DAX=CurrencyConvert(DAX, EURO2USD); CAC40=CurrencyConvert(CAC40, EURO2USD); FTAS=CurrencyConvert(FTAS, GBP2USD); SSMI=CurrencyConvert(SSMI, SF2USD);Now all the currencies for the financial stock indices for 7 sectors are obtained in US dollars.
In this part, we calculated the expected returns and covariance matrix in annual steps for a period of 10 years. I used the data for 7 markets or sectors were obtained in the first step and calculated their expected returns and covariance matrix. The expected rate of return is a probability-weighted average of the rates of return in each scenario. We may write the expected return as:
Where,First of all, I initialized a column matrix and filled it with the above data and took log of each data separately by using MATLAB commands as follows:
covmat=cell(1,11); ret=flipud([log(SSMI.Close) log(FTAS.Close) log(CAC40.Close) log(DAX.Close) log(GSPTSE.Close) log(snp500.Close) log(NDX.Close)]);
Further, I calculated the differences between adjacent elements of each data using the diff command in MATLAB.
logRet=[diff(ret(:,1)) diff(ret(:,2)) diff(ret(:,3)) diff(ret(:,4)) diff(ret(:,5)) diff(ret(:,6)) diff(ret(:,7))];
Expected return is nothing other than a guaranteed rate of return. However, it can be used to forecast the future value of a market, and it also provides a guide from which to measure actual returns. Hence to calculate the expected return, I first take two indices with w as a variable where w = 1:10 and calculated these indices for all the values of w and finally took mean value of each data with these two indices as follows:
ind=[(w-1)*12+1 (w+10)*12]; estReturn(w,:)=[mean(logRet(ind(1):ind(2),1)) mean(logRet(ind(1):ind(2),2)) mean(logRet(ind(1):ind(2),3)) mean(logRet(ind(1):ind(2),4)) mean(logRet(ind(1):ind(2),5)) mean(logRet(ind(1):ind(2),6)) mean(logRet(ind(1):ind(2),7))];
The above values calculated for all the 10 times and hence it is placed within a for loop. estReturn gives us the estimated return for a single month and now there’s a need to convert it to annual return, which is accomplished by below command, simply by mutilpying it with 12.
estReturn(w,:)=estReturn(w,:)*12;
After the calculation of expected return annually, I used the command var(X) to calculate the variance of the data. Although it was not asked to calculate in the problem but in order to calculate the covariance, it is required to first obtain the data such that each row of the matrix becomes an observation and each column is a variable. The command used for the calculation of variance is as shown below:
stdRet(w,:)=sqrt(12*var([ logRet(ind(1):ind(2),1) logRet(ind(1):ind(2),2) logRet(ind(1):ind(2),3) logRet(ind(1):ind(2),4) logRet(ind(1):ind(2),5) logRet(ind(1):ind(2),6) logRet(ind(1):ind(2),7)]));
Finally, I used the MATLAB command cov(x) to calculate the covariance of the data. The syntax used is:
Y = cov(X)Where,
Expected Return | SSMI | FTAS | CAC40 | DAX | GSPTSE | SNP50 | NDX |
1st year | 0.0625 | 0.0373 | 0.0524 | 0.0632 | 0.0700 | 0.0848 | 0.0644 |
2nd year | 0.0954 | 0.0531 | 0.0762 | 0.0846 | 0.0884 | 0.0921 | 0.1290 |
3rd year | 0.0872 | 0.0506 | 0.0972 | 0.0940 | 0.0915 | 0.0763 | 0.1004 |
4th year | 0.0742 | 0.0457 | 0.0814 | 0.0925 | 0.0747 | 0.0610 | 0.0835 |
5th year | 0.0006 | -0.0064 | 0.0122 | 0.0147 | 0.0321 | -0.0058 | 0.0110 |
6th year | -0.0112 | 0.0007 | -0.0039 | 0.0103 | 0.0537 | -0.0055 | 0.0115 |
7th year | -0.0144 | -0.0069 | -0.0356 | 0.0115 | 0.0494 | -0.0148 | -0.0307 |
8th year | -0.0314 | -0.0034 | -0.0573 | -0.0041 | 0.0295 | -0.0048 | -0.0080 |
9th year | 0.0081 | 0.0180 | -0.0209 | 0.0359 | 0.0454 | 0.0198 | 0.0470 |
10th year | 0.0431 | 0.0529 | 0.0228 | 0.0907 | 0.0644 | 0.0575 | 0.1007 |
Table 1: Expected Returns for 10 years
Covariance Matrix for 1st year | ||||||
SSMI | FTAS | CAC40 | DAX | GSPTSE | SNP50 | NDX |
0.0334 | 0.0191 | 0.0285 | 0.0324 | 0.0168 | 0.0190 | 0.0196 |
0.0191 | 0.0201 | 0.0234 | 0.0271 | 0.0155 | 0.0169 | 0.0257 |
0.0285 | 0.0234 | 0.0434 | 0.0444 | 0.0211 | 0.0226 | 0.0380 |
0.0324 | 0.0271 | 0.0444 | 0.0609 | 0.0252 | 0.0280 | 0.0527 |
0.0168 | 0.0155 | 0.0211 | 0.0252 | 0.0268 | 0.0198 | 0.0342 |
0.0190 | 0.0169 | 0.0226 | 0.0280 | 0.0198 | 0.0234 | 0.0379 |
0.0196 | 0.0257 | 0.0380 | 0.0527 | 0.0342 | 0.0379 | 0.1411 |
Covariance Matrix for 2nd year | ||||||
SSMI | FTAS | CAC40 | DAX | GSPTSE | SNP50 | NDX |
0.0318 | 0.0179 | 0.0273 | 0.0322 | 0.0162 | 0.0185 | 0.0235 |
0.0179 | 0.0180 | 0.0213 | 0.0258 | 0.0151 | 0.0161 | 0.0269 |
0.0273 | 0.0213 | 0.0404 | 0.0427 | 0.0209 | 0.0219 | 0.0390 |
0.0322 | 0.0258 | 0.0427 | 0.0590 | 0.0255 | 0.0279 | 0.0503 |
0.0162 | 0.0151 | 0.0209 | 0.0255 | 0.0265 | 0.0193 | 0.0367 |
0.0185 | 0.0161 | 0.0219 | 0.0279 | 0.0193 | 0.0230 | 0.0394 |
0.0235 | 0.0269 | 0.0390 | 0.0503 | 0.0367 | 0.0394 | 0.1014 |
Covariance Matrix for 3rd year | ||||||
SSMI | FTAS | CAC40 | DAX | GSPTSE | SNP50 | NDX |
0.0314 | 0.0181 | 0.0280 | 0.0320 | 0.0164 | 0.0186 | 0.0237 |
0.0181 | 0.0181 | 0.0214 | 0.0261 | 0.0152 | 0.0160 | 0.0270 |
0.0280 | 0.0214 | 0.0397 | 0.0433 | 0.0212 | 0.0224 | 0.0399 |
0.0320 | 0.0261 | 0.0433 | 0.0579 | 0.0259 | 0.0282 | 0.0509 |
0.0164 | 0.0152 | 0.0212 | 0.0259 | 0.0266 | 0.0194 | 0.0371 |
0.0186 | 0.0160 | 0.0224 | 0.0282 | 0.0194 | 0.0227 | 0.0395 |
0.0237 | 0.0270 | 0.0399 | 0.0509 | 0.0371 | 0.0395 | 0.1014 |
In this part, it was asked to plot the 11 different frontiers in one figure. The concept of efficient frontier was introduced by Harry Markowitz and it is defined as if a portfolio or a combination of assets has the best expected rate of return for the level of risk, it is facing, then it will be referred as “efficient”.
Few more MATLAB Projects:
In order plot them, I used the below code in MATLAB, I used different markers for different plots so that they could be distinguished from one another quite easily. Moreover, I used the command legend in order to show the respective years for which the graphs are plotted. RF is a variable which indicate the risk-free rate and as it is asked to operate under efficient frontier that’s why risk-free rate is equal to zero.
RF=0; for w=1:10 [xopt(:,w), muopt(w), sigopt(w)] = highest_slope_portfolio( covmat{1,w}, RF, estReturn(w,:)', stdRet(w,:) ); end mker=['o' '+' '*' '.' 'x' 's' 'd' '^' '>' '<'] figure for w=1:10 plot (sigopt(w), muopt(w) ,'Marker', mker(w)); hold on; plot (0, RF, 'o'); hold on; RF_p1 = [0 sigopt(w) 2* sigopt(w)]; opt1_p = [.02 muopt(w) (2 * muopt(w) - RF) ]; line(RF_p1, opt1_p ); end legend('Year 1994', 'Year 1995', 'Year 1996', 'Year 1997','Year 1998','Year 1999','Year 2000', 'Year 2001', 'Year 2002', 'Year 2003')In this code, first of all I used highest_slope_portfolio function. This function finds the portfolio with the highest slope. Results are shown in the below figure annually:
The plot in Part (c) was about the efficient frontier with risk rate equal to zero i.e. operating in an ideal condition while in this part, it was asked to plot the same graphs but this time include a risk-free rate of 3%. Hence I used the same code as for the previous part but only this time I used RF = 0.03 as I needed to include a risk free rate of 3%. The code used in MATLAB for this part is shown below:
RF=0.03; %the risk free rate for w=1:10 [xoptRF{w}, muoptRF(w), sigoptRF(w)] = highest_slope_portfolio( covmat{1,w}, RF, estReturn(w,:)', stdRet(w,:) ); end figure for w=1:10 plot (sigoptRF(w), muoptRF(w) ,'Marker', mker(w)); hold on; plot (0, RF, 'o'); hold on; RF_p1 = [0 sigoptRF(w) 2* sigoptRF(w)]; opt1_p = [.02 muoptRF(w) (2 * muoptRF(w) - RF) ]; line(RF_p1, opt1_p ); end legend('Year 1994', 'Year 1995', 'Year 1996', 'Year 1997','Year 1998','Year 1999','Year 2000', 'Year 2001', 'Year 2002', 'Year 2003')
The result for this part i.e. after including a risk-free rate of 3% is shown in the figure below. If the Figure 1 and Figure 2 are closely examined then one can see the clear difference. When the risk-free rate was considered zero, all the expected estimate graphs were in positive direction depicting the profit annually while after adding a risk-free rate of 3%, few of the graphs went in the negative direction depicting the loss in those years. Hence adding the risk factor may cause the business to get deceased and it may even cause it to decline continuously which results in disaster.
That's all for today, in the coming post, I will calculate more financial terms like Optimal asset allocation, average return, standard deviation and much more, so stay tuned and have fun.
Arduino Wifi Shield is used to connect Arduino board with Wifi. After connectivity with Wifi, one can perform many tasks using this shield. We can built a complete server on it and can also use it as a client. Server designed on an Arduino Wifi Shield are usually quite simple as it doesn’t have much processing power to support heavy server. Arduino Wifi Shield is mostly used in home automation projects where home appliances are controlled by Wifi or can also be used for security purposes. In short, it has numerous applications and is widely used.
In today’s project, we will use Arduino UNO board for programming purposes, and will interface two leds with it and then we will control these leds via an online web server. Using that online web server, we will ON and OFF these leds on command. For controlling leds from an online server, we have to design two things:
Their arrangement and pin configuration is shown in the Arduino Web Client section. We will arrange them in such a way that two leds will be mounted on the Arduino UNO shield. In web server, we will design a simple page, which will be having four buttons on it, which will be:
When someone will open this web page and will pres any of these buttons, respective task will be performed on the Leds. i.e. if someone pressed the LED 1 ON button then Led 1 present on the Arduino board will get ON and when someone press LED 1 OFF button, that Led will go OFF and same function will be performed for second led. There won’t be any connection between the hardware and that web server, the only connection will be the Wifi. The Arduino Shield must have a Wifi connection available and one sitting from across the world can control them. Now let’s discuss these two parts, one by one.
I have designed the online web server on my own site The Engineering Projects. This is a php page which I have uploaded on my web server. In order to make this page, simply follow the below steps:
Note:
#include <SPI.h> #include <WiFi.h> char ssid[] = “EvoWingle-12F3“; // your network SSID (name) char pass[] = “093B3453“; // your network password (use for WPA, or use as key for WEP) int keyIndex = 0; // your network key Index number (needed only for WEP) int status = WL_IDLE_STATUS; char server[] = “www.theengineeringprojects.com“; // name address for Google (using DNS) String location = “/Examples/data.txt HTTP/1.0“; char inString[500]; // string for incoming serial data int stringPos = 0; // string index counter byte statusLed = 0; char c; int led1 = 3; int led2 = 4; WiFiClient client; unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds boolean lastConnected = false; // state of the connection last time through the main loop const unsigned long postingInterval = 10*1000; // delay between updates, in milliseconds void setup() { //Initialize serial and wait for port to open: Serial.begin(9600); pinMode(led1,OUTPUT); pinMode(led2,OUTPUT); digitalWrite(led1, LOW); digitalWrite(led2, LOW); // check for the presence of the shield: if (WiFi.status() == WL_NO_SHIELD) { Serial.println(“WiFi shield not present”); // don’t continue: while(true); } // attempt to connect to Wifi network: while ( status != WL_CONNECTED) { Serial.print(“Attempting to connect to SSID: “); Serial.println(ssid); // Connect to WPA/WPA2 network. Change this line if using open or WEP network: status = WiFi.begin(ssid, pass); // wait 10 seconds for connection: delay(10000); } Serial.println(“Connected to wifi”); printWifiStatus(); Serial.println(“nStarting connection to server…”); // if you get a connection, report back via serial: if (client.connect(server, 80)) { Serial.println(“connected to server”); // Make a HTTP request: client.print(“GET “); client.println(location); client.println(“Host: theengineeringprojects.com”); // client.println(“Connection: close”); client.println(); //readPage(); }else{ Serial.println(“connection failed”); } } void loop(){ while (client.available()) { c = client.read(); Serial.write(c); CheckingStatus(); } if (!client.connected() && lastConnected) { Serial.println(); Serial.println(“disconnecting.”); client.stop(); } if(!client.connected() && (millis() – lastConnectionTime > postingInterval)) { PingRequest(); } lastConnected = client.connected(); } void PingRequest(){ if (client.connect(server, 80)) { // Serial.println(“connected to server”); // Make a HTTP request: client.print(“GET “); client.println(location); client.println(“Host: theengineeringprojects.com”); client.println(“Connection: close”); client.println(); //readPage(); lastConnectionTime = millis(); }else{ //Serial.println(“connection failed”); client.stop(); } } void CheckingStatus(){ inString[stringPos] = c; if(c == ‘*’) { statusLed = inString[stringPos - 1]; stringPos = 0; // Serial.write(statusLed); delay(500); UpdatingStatus(); // delay(500); // client.flush(); // delay(10000); //PingServer(); } stringPos ++; } void UpdatingStatus(){ if(statusLed == ’1') { digitalWrite(led1, HIGH); // Serial.write(‘OK’); } if(statusLed == ’2') { digitalWrite(led1, LOW); } if(statusLed == ’3') { digitalWrite(led2, HIGH); } if(statusLed == ’4') { digitalWrite(led2, LOW); } } void printWifiStatus() { // print the SSID of the network you’re attached to: Serial.print(“SSID: “); Serial.println(WiFi.SSID()); // print your WiFi shield’s IP address: IPAddress ip = WiFi.localIP(); Serial.print(“IP Address: “); Serial.println(ip); // print the received signal strength: long rssi = WiFi.RSSI(); Serial.print(“signal strength (RSSI):”); Serial.print(rssi); Serial.println(” dBm”); }
That’s all for today, Stay Blessed, take care. :))
Hello friends, today I am going to post a complete project designed on MATLAB named as Modelling of DVB-T2 system using Consistent Channel Frequency in MATLAB. This project is designed by our team and it involved a lot of effort to bring it into existence that's why its not free but as usual I have discussed all the details below related to it, which will help you understanding it and if you want to buy it then you can click on the Buy button shown above.
This project aims to implement a DVB-T2 (Digital Video Broadcasting for terrestrial television) system using consistent channel frequency responses. Tthe code is designed to use the same output from a channel model for different transmitter configurations so that consistency of performance results can be obtained. After that the overall project will be modified to repeat an experiment “n” times collecting data so that “x%” confidence intervals can be calculated. Historically, DVB is a project worked by more than 250 companies around Europe at first and now worldwide. DVB-T2 is the world’s most advanced digital terrestrial television (DTT) system, offering more robustness, flexibility and at least 50% more efficiency than any other DTT system. It supports SD, HD, mobile TV, or any combination thereof. The GUI for DVB-T2 parameters selection in MATLAB is shown on the left.
DVB-T2 is the second generation standard technology used for digital terrestrial TV broadcasting. As it’s a new technology so it has many fields to explore and research, and the best way of researching on any new technology is via simulations. Simulations provide an easy and efficient way to evaluate the performance of any system. For simulation purposes, MATLAB software was chosen in this thesis because of its wide range of tools and ability to show graphical results in a very appropriate form. . Further, this DVB-T2 simulation model could be extended easily to simulate DVB-H, which shares many features with DVB-T2 (only the physical layer that needs modification). The most important feature, I discussed in my simulations are:
DVB-T2 scheme can handle wide range of sub carriers from a range of 1k to 32k; these sub carriers can be fixed or mobile. In this thesis, experiments are performed on mobile transmission of signals to 4000 sub carriers. Below are discussed three different mobile scenarios, for different speeds of mobiles user, which are:
In all the scenarios, the factors mentioned below are kept constant so that a real comparison can be obtained and it could be checked that whether the speed affects the signal or not. These constant factors are:
During this thesis, help was taken from a MATLAB model of DVB-T2 transmission system designed by a student at Brunel University. First this initial model was studied and then enhanced it to a higher level. The first model designed by the student at Brunel University, performed the iterations on the DVB-T2 system and gives the results for just one cycle. Explanation of this initial model is discussed in detail below.
After the user input all the values in the GUI, this model first calculates the below three values depending on the number of subcarriers attached to the DVB-T2 system.
After getting this information, the model performs the QAM modulation over the signal so that it could be sent from the transmitter to the receiver. Next, depending on the value of Pilot Pattern given by the user, it calculates the scattered Pilot Amplitudes for the system. After that, it calculates the distortion in transmission depending on area in which the signal is propagating.
In order to calculate the distortion, FFT technique is performed on the signals to get their frequency response. As the signal has already sent from the transmitter after QAM modulation so demodulation on the receiver side is necessary. The model performs the same and demodulates the signal and finally it calculates the value of Signal to noise ratio (SNR) and Bit Error Rate (BER). At the end, it simply plots the graphs of SNR and BER for the visual representation.
Different experiments were performed on the initial model and checked its results. The results are given below for three different experiments, which are:
Results of these experiments are shown in figure 6.1, 6.2 and 6.3 respectively. Table 6.1, 6.2 and 6.3 gives the values of BER and average BER for all the values of SNR. If these three graphs are closely examined then it can be shown that the band limited impulse response increases as the speed increase and so as the BER and SNR.
The reason for such behavior is that because as the speed of the mobile increase, signal distortion also increases and it becomes difficult for the receiver to catch the signal, that’s the main reason that user travelling in high speed vehicle faces more distortion as compared to a pedestrian.
SNR | BER & Average BER |
SNR: 0 | BER:0.103833 |
SNR: 0 | NoAvrg_BER:0.160358 |
SNR: 5 | BER:0.014366 |
SNR: 5 | NoAvrg_BER:0.033706 |
SNR: 10 | BER:0.000206 |
SNR: 10 | NoAvrg_BER:0.001528 |
SNR: 15 | BER:0.000002 |
SNR: 15 | NoAvrg_BER:0.000107 |
SNR: 20 | BER:0.001543 |
SNR: 20 | NoAvrg_BER:0.002319 |
SNR: 25 | BER:0.000076 |
SNR: 25 | NoAvrg_BER:0.000184 |
SNR: 30 | BER:0.000000 |
SNR: 30 | NoAvrg_BER:0.000164 |
BER & Average BER Vs. SNR for experiment 1
SNR | BER & Average BER |
SNR: 0 | BER:0.140855 |
SNR: 0 | NoAvrg_BER:0.195596 |
SNR:5 | BER:0.046527 |
SNR:5 | NoAvrg_BER:0.071364 |
SNR:10 | BER:0.011363 |
SNR:10 | NoAvrg_BER:0.019860 |
SNR:15 | BER:0.003815 |
SNR:15 | NoAvrg_BER:0.006448 |
SNR:20 | BER:0.000604 |
SNR:20 | NoAvrg_BER:0.001222 |
SNR:25 | BER:0.000214 |
SNR:25 | NoAvrg_BER:0.000404 |
SNR:30 | BER:0.000233 |
SNR:30 | NoAvrg_BER:0.000503 |
SNR | BER & Average BER |
SNR: 0 | BER:0.128177 |
SNR: 0 | NoAvrg_BER:0.182924 |
SNR:5 | BER:0.056198 |
SNR:5 | NoAvrg_BER:0.084254 |
SNR:10 | BER:0.023229 |
SNR:10 | NoAvrg_BER:0.035131 |
SNR:15 | BER:0.006793 |
SNR:15 | NoAvrg_BER:0.010362 |
SNR:20 | BER:0.001748 |
SNR:20 | NoAvrg_BER:0.002801 |
SNR:25 | BER:0.000425 |
SNR:25 | NoAvrg_BER:0.000691 |
SNR:30 | BER:0.000354 |
SNR:30 | NoAvrg_BER:0.000515 |
BER & Average BER vs. SNR for experiment 3
Although the results given by these simulations were quite accurate but they were not accurate enough to be trusted, as they were performing the process just for one period and getting the results on the basis of that.
The initial MATLAB model is modified in this thesis, in order to use the same output from the channel model with different transmitter configurations to obtain more consistent results that can be compared with each other. Then theDVB-T2model will be modified so that it can be simulated using Matlab n times collecting data so that an x% confidence interval can be measured.
The results obtained after modifications were very consistent as they were performing the whole scenario for N times (defined by the user), this attribute lacks in the initial model as it was performing the complete task just for one cycle of time and any kind of distortion could fluctuate the results. While in modified model, the same process was performed by N times defined by the user and the results obtained are actually the average of all the cycles and hence providing a very consistent output, which couldn’t be distorted by any external factors.
Moreover, this new model further enhanced the initial model to calculate the Mean BER as it will give the overall performance of BER and average BER. Furthermore, calculates the standard BER on the basis of which global BER is also calculated.As the simulation of DVB-T2 requires a lot of input parameters from the user, that’s why a GUI is also designed in MATLAB, which makes the working of this project user friendly. User can easily change the parameters of the system using that GUI. On startup, the GUI looks like as shown in figure 4.2:
As mentioned above, taking all the other parameters constant, three experiments are performed for the mobile user moving at different speeds with different Iterations and no. of repeats, which are:
Results of the first experiment are shown in the figure 6.5, 6.6 and 6.7 respectively. While the theoretical values of BER and average BER for the corresponding SNR are shown in table 6.4 and the Mean BER and std BER are shown in table 6.5.
For N=1 | For N=2 | ||
SNR: 0 | BER:0.131272 | SNR: 0 | BER:0.131542 |
SNR: 0 | NoAvrg_BER:0.185916 | SNR: 0 | NoAvrg_BER:0.186218 |
SNR:1 | BER:0.107086 | SNR:1 | BER:0.106672 |
SNR:1 | NoAvrg_BER:0.157698 | SNR:1 | NoAvrg_BER:0.157319 |
SNR:2 | BER:0.086805 | SNR:2 | BER:0.086459 |
SNR:2 | NoAvrg_BER:0.129841 | SNR:2 | NoAvrg_BER:0.129562 |
SNR:3 | BER:0.087178 | SNR:3 | BER:0.086924 |
SNR:3 | NoAvrg_BER:0.128066 | SNR:3 | NoAvrg_BER:0.127755 |
SNR:4 | BER:0.081465 | SNR:4 | BER:0.081709 |
SNR:4 | NoAvrg_BER:0.116619 | SNR:4 | NoAvrg_BER:0.116581 |
SNR:5 | BER:0.028071 | SNR:5 | BER:0.028074 |
SNR:5 | NoAvrg_BER:0.051596 | SNR:5 | NoAvrg_BER:0.051751 |
SNR:6 | BER:0.016450 | SNR:6 | BER:0.016439 |
SNR:6 | NoAvrg_BER:0.030762 | SNR:6 | NoAvrg_BER:0.030725 |
SNR:7 | BER:0.012705 | SNR:7 | BER:0.012607 |
SNR:7 | NoAvrg_BER:0.022399 | SNR:7 | NoAvrg_BER:0.022108 |
SNR:8 | BER:0.036446 | SNR:8 | BER:0.036612 |
SNR:8 | NoAvrg_BER:0.052421 | SNR:8 | NoAvrg_BER:0.052642 |
SNR:9 | BER:0.026200 | SNR:9 | BER:0.026378 |
SNR:9 | NoAvrg_BER:0.039987 | SNR:9 | NoAvrg_BER:0.040434 |
SNR:10 | BER:0.014162 | SNR:10 | BER:0.014155 |
SNR:10 | NoAvrg_BER:0.023779 | SNR:10 | NoAvrg_BER:0.023805 |
SNR:11 | BER:0.007526 | SNR:11 | BER:0.007539 |
SNR:11 | NoAvrg_BER:0.013874 | SNR:11 | NoAvrg_BER:0.013838 |
SNR:12 | BER:0.015524 | SNR:12 | BER:0.015382 |
SNR:12 | NoAvrg_BER:0.023693 | SNR:12 | NoAvrg_BER:0.023602 |
SNR:13 | BER:0.005303 | SNR:13 | BER:0.005448 |
SNR:13 | NoAvrg_BER:0.008758 | SNR:13 | NoAvrg_BER:0.008764 |
SNR:14 | BER:0.008712 | SNR:14 | BER:0.008823 |
SNR:14 | NoAvrg_BER:0.014517 | SNR:14 | NoAvrg_BER:0.014421 |
SNR:15 | BER:0.013224 | SNR:15 | BER:0.013144 |
SNR:15 | NoAvrg_BER:0.019547 | SNR:15 | NoAvrg_BER:0.019305 |
SNR:16 | BER:0.001919 | SNR:16 | BER:0.001890 |
SNR:16 | NoAvrg_BER:0.003767 | SNR:16 | NoAvrg_BER:0.003703 |
SNR:17 | BER:0.002873 | SNR:17 | BER:0.002907 |
SNR:17 | NoAvrg_BER:0.004932 | SNR:17 | NoAvrg_BER:0.005001 |
SNR:18 | BER:0.000610 | SNR:18 | BER:0.000641 |
SNR:18 | NoAvrg_BER:0.001197 | SNR:18 | NoAvrg_BER:0.001243 |
SNR:19 | BER:0.006294 | SNR:19 | BER:0.006231 |
SNR:19 | NoAvrg_BER:0.009262 | SNR:19 | NoAvrg_BER:0.009209 |
SNR:20 | BER:0.001799 | SNR:20 | BER:0.001749 |
SNR:20 | NoAvrg_BER:0.003268 | SNR:20 | NoAvrg_BER:0.003248 |
SNR:21 | BER:0.000966 | SNR:21 | BER:0.000998 |
SNR:21 | NoAvrg_BER:0.001677 | SNR:21 | NoAvrg_BER:0.001636 |
SNR:22 | BER:0.001733 | SNR:22 | BER:0.001778 |
SNR:22 | NoAvrg_BER:0.002772 | SNR:22 | NoAvrg_BER:0.002883 |
SNR:23 | BER:0.004920 | SNR:23 | BER:0.004914 |
SNR:23 | NoAvrg_BER:0.007638 | SNR:23 | NoAvrg_BER:0.007743 |
SNR:24 | BER:0.000089 | SNR:24 | BER:0.000098 |
SNR:24 | NoAvrg_BER:0.000220 | SNR:24 | NoAvrg_BER:0.000234 |
SNR:25 | BER:0.000001 | SNR:25 | BER:0.000001 |
SNR:25 | NoAvrg_BER:0.000052 | SNR:25 | NoAvrg_BER:0.000052 |
SNR:26 | BER:0.000408 | SNR:26 | BER:0.000393 |
SNR:26 | NoAvrg_BER:0.000695 | SNR:26 | NoAvrg_BER:0.000646 |
SNR:27 | BER:0.000583 | SNR:27 | BER:0.000600 |
SNR:27 | NoAvrg_BER:0.001222 | SNR:27 | NoAvrg_BER:0.001242 |
SNR:28 | BER:0.000352 | SNR:28 | BER:0.000381 |
SNR:28 | NoAvrg_BER:0.000609 | SNR:28 | NoAvrg_BER:0.000625 |
SNR:29 | BER:0.000107 | SNR:29 | BER:0.000124 |
SNR:29 | NoAvrg_BER:0.000365 | SNR:29 | NoAvrg_BER:0.000384 |
SNR:30 | BER:0.000367 | SNR:30 | BER:0.000351 |
SNR:30 | NoAvrg_BER:0.000720 | SNR:30 | NoAvrg_BER:0.000695 |
SNR Vs. BER values for Experiment 1
Mean BER | std BER |
-0.8814 | 0.0006 |
-0.9711 | 0.0012 |
-1.0623 | 0.0012 |
-1.0602 | 0.0009 |
-1.0884 | 0.0009 |
-1.5517 | 0.0000 |
-1.7840 | 0.0002 |
-1.8977 | 0.0024 |
-1.4374 | 0.0014 |
-1.5802 | 0.0021 |
-1.8490 | 0.0001 |
-2.1231 | 0.0005 |
-1.8110 | 0.0028 |
-2.2696 | 0.0083 |
-2.0571 | 0.0039 |
-1.8799 | 0.0019 |
-2.7203 | 0.0046 |
-2.5391 | 0.0035 |
-3.2039 | 0.0151 |
-2.2033 | 0.0031 |
-2.7511 | 0.0086 |
-3.0078 | 0.0099 |
-2.7556 | 0.0079 |
-2.3083 | 0.0004 |
-4.0308 | 0.0285 |
-6.1938 | 0 |
-3.3978 | 0.0118 |
-3.2281 | 0.0086 |
-3.4365 | 0.0247 |
-3.9387 | 0.0460 |
-3.4455 | 0.0137 |
Mean BER & std BER values for Experiment 1
For N = 1 | For N = 2 | ||
SNR: 0 | BER:0.144963 | SNR: 0 | BER:0.144537 |
SNR: 0 | NoAvrg_BER:0.200382 | SNR: 0 | NoAvrg_BER:0.200617 |
SNR:1 | BER:0.103536 | SNR:1 | BER:0.103496 |
SNR:1 | NoAvrg_BER:0.153318 | SNR:1 | NoAvrg_BER:0.153312 |
SNR:2 | BER:0.081079 | SNR:2 | BER:0.081874 |
SNR:2 | NoAvrg_BER:0.123080 | SNR:2 | NoAvrg_BER:0.123966 |
SNR:3 | BER:0.056279 | SNR:3 | BER:0.056618 |
SNR:3 | NoAvrg_BER:0.096223 | SNR:3 | NoAvrg_BER:0.096636 |
SNR:4 | BER:0.070647 | SNR:4 | BER:0.070241 |
SNR:4 | NoAvrg_BER:0.103436 | SNR:4 | NoAvrg_BER:0.103023 |
SNR:5 | BER:0.063094 | SNR:5 | BER:0.063427 |
SNR:5 | NoAvrg_BER:0.089725 | SNR:5 | NoAvrg_BER:0.090577 |
SNR:6 | BER:0.020785 | SNR:6 | BER:0.021318 |
SNR:6 | NoAvrg_BER:0.039970 | SNR:6 | NoAvrg_BER:0.040469 |
SNR:7 | BER:0.024660 | SNR:7 | BER:0.024455 |
SNR:7 | NoAvrg_BER:0.040979 | SNR:7 | NoAvrg_BER:0.041170 |
SNR:8 | BER:0.032986 | SNR:8 | BER:0.032662 |
SNR:8 | NoAvrg_BER:0.052140 | SNR:8 | NoAvrg_BER:0.052100 |
SNR:9 | BER:0.023306 | SNR:9 | BER:0.022988 |
SNR:9 | NoAvrg_BER:0.037168 | SNR:9 | NoAvrg_BER:0.037283 |
SNR:10 | BER:0.009120 | SNR:10 | BER:0.008878 |
SNR:10 | NoAvrg_BER:0.017749 | SNR:10 | NoAvrg_BER:0.017499 |
SNR:11 | BER:0.023258 | SNR:11 | BER:0.023224 |
SNR:11 | NoAvrg_BER:0.034964 | SNR:11 | NoAvrg_BER:0.034473 |
SNR:12 | BER:0.023534 | SNR:12 | BER:0.023745 |
SNR:12 | NoAvrg_BER:0.034579 | SNR:12 | NoAvrg_BER:0.034325 |
SNR:13 | BER:0.000103 | SNR:13 | BER:0.000101 |
SNR:13 | NoAvrg_BER:0.000588 | SNR:13 | NoAvrg_BER:0.000648 |
SNR:14 | BER:0.000016 | SNR:14 | BER:0.000010 |
SNR:14 | NoAvrg_BER:0.000196 | SNR:14 | NoAvrg_BER:0.000231 |
SNR:15 | BER:0.000009 | SNR:15 | BER:0.000014 |
SNR:15 | NoAvrg_BER:0.000209 | SNR:15 | NoAvrg_BER:0.000240 |
SNR:16 | BER:0.001996 | SNR:16 | BER:0.002008 |
SNR:16 | NoAvrg_BER:0.003367 | SNR:16 | NoAvrg_BER:0.003535 |
SNR:17 | BER:0.002367 | SNR:17 | BER:0.002430 |
SNR:17 | NoAvrg_BER:0.003467 | SNR:17 | NoAvrg_BER:0.003535 |
SNR:18 | BER:0.000002 | SNR:18 | BER:0.000004 |
SNR:18 | NoAvrg_BER:0.000010 | SNR:18 | NoAvrg_BER:0.000018 |
SNR:19 | BER:0.001298 | SNR:19 | BER:0.001367 |
SNR:19 | NoAvrg_BER:0.002071 | SNR:19 | NoAvrg_BER:0.002116 |
SNR:20 | BER:0.009918 | SNR:20 | BER:0.009850 |
SNR:20 | NoAvrg_BER:0.014701 | SNR:20 | NoAvrg_BER:0.014585 |
SNR:21 | BER:0.000472 | SNR:21 | BER:0.000521 |
SNR:21 | NoAvrg_BER:0.000769 | SNR:21 | NoAvrg_BER:0.000854 |
SNR:22 | BER:0.001085 | SNR:22 | BER:0.001169 |
SNR:22 | NoAvrg_BER:0.001855 | SNR:22 | NoAvrg_BER:0.001917 |
SNR:23 | BER:0.001360 | SNR:23 | BER:0.001495 |
SNR:23 | NoAvrg_BER:0.002240 | SNR:23 | NoAvrg_BER:0.002427 |
SNR:24 | BER:0.000595 | SNR:24 | BER:0.000621 |
SNR:24 | NoAvrg_BER:0.001258 | SNR:24 | NoAvrg_BER:0.001321 |
SNR:25 | BER:0.000873 | SNR:25 | BER:0.000820 |
SNR:25 | NoAvrg_BER:0.001457 | SNR:25 | NoAvrg_BER:0.001422 |
SNR:26 | BER:0.000003 | SNR:26 | BER:0.000003 |
SNR:26 | NoAvrg_BER:0.000199 | SNR:26 | NoAvrg_BER:0.000201 |
SNR:27 | BER:0.000326 | SNR:27 | BER:0.000342 |
SNR:27 | NoAvrg_BER:0.000637 | SNR:27 | NoAvrg_BER:0.000651 |
SNR:28 | BER:0.000198 | SNR:28 | BER:0.000216 |
SNR:28 | NoAvrg_BER:0.000270 | SNR:28 | NoAvrg_BER:0.000262 |
SNR:29 | BER:0.000000 | SNR:29 | BER:0.000000 |
SNR:29 | NoAvrg_BER:0.000000 | SNR:29 | NoAvrg_BER:0.000000 |
SNR:30 | BER:0.000000 | SNR:30 | BER:0.000000 |
SNR:30 | NoAvrg_BER:0.000071 | SNR:30 | NoAvrg_BER:0.000078 |
SNR Vs. BER values for Experiment 2
Mean BER | Std BER |
0.8394 | 0.0009 |
0.9850 | 0.0001 |
1.0890 | 0.0030 |
1.2483 | 0.0018 |
1.1522 | 0.0018 |
1.1989 | 0.0016 |
1.6767 | 0.0078 |
1.6098 | 0.0026 |
1.4838 | 0.0030 |
1.6355 | 0.0042 |
2.0458 | 0.0083 |
1.6337 | 0.0005 |
1.6264 | 0.0027 |
3.9915 | 0.0072 |
4.8895 | 0.1323 |
4.9486 | 0.1512 |
2.6985 | 0.0018 |
2.6201 | 0.0081 |
5.5089 | 0.1569 |
2.8755 | 0.0159 |
2.0051 | 0.0021 |
3.3048 | 0.0302 |
2.9484 | 0.0231 |
2.8460 | 0.0291 |
3.2160 | 0.0133 |
3.0727 | 0.0192 |
5.4949 | 0 |
3.4765 | 0.0154 |
3.6850 | 0.0273 |
Inf | NaN |
Inf | NaN |
Mean BER and std BER values for Experiment 2
This thesis presents the design and Implementation of DVB-T2 system in MATLAB software. The basic purpose of this thesis is to check the bit error ratio (BER) and signal to noise ratio (SNR) for DVB-T2 system so that the system could be improved to a better quality. DVB-T2 system is evaluated for mobile users moving at different speeds. It is clearly shown that the mobility has an impact on the received signal, where the SNR goes to zero in some points. This behavior will generate high BER. If the figures for impulse responses are checked for all the three experiments then it is depicted that the Impulse is high for the third experiment where the mobility speed is higher than the first two experiments. The packet data loss is almost zero for the first experiment while it’s increasing in the second and is higher in the third. The number of packet lost confirms this behavior that high losses occurred in the case of high mobility.
In the last post, we were able to get the continuous data from COM port using Labview and we have also separated the data based on a character which I have used this one "," i.e. comma. Now, suppose you are sending 3 values from your COM port and these are the sensors' values so tthe best way to display these value is by using a graph. In the last post we separated the values and displayed them in a 1D array, so today we are gonna display those values in a graph. As I have taken three values so today I am gonna plot 3 graphs. Each graph will show one of the values and display them in real time. Let's start it.