Gauss-Zeidel optimization routines

This is simplest optimization routines. Using this algorithm optimization parameters are changed separately in each step. Only one parameter can be changed in one step while other are helt as constants. Xk+1=Xk+ΔXk , k=0,1,2,… ΔXk step of parameter Xk. Parameter is changed until function growth is noticed, and then next parameter follows and so on. After cycle with all parameters is completed, then step is changed to half of its value and repeat cycle again. Optimal point searching ends when there is no function increase and last point is held as optimal point. Lets see how it works with following function: Its plot: Using MATLAB script we get results bellow. In each picture start coordinates are different. Start coordinates. x=150; y=200; Start coordinates x=50; y=150; Other example Start coordinates x=10; y=10; Start coordinates x=100; y=200; Third example Start coordinates x=10; y=10; Start coordinates x=50; y=200; Matlab script: close all; clear all; clc; [X,Y] = meshgrid(-100:1:100, -100:1:100); Z =3*exp(-((X.^2)/78000) -((Y.^2)/20000))-5*exp(-(((X+31).^2)/123) -(((Y+20).^2)/5000)); xx=100; yy=100; contour3(Z,20); hold on; % figure(2); mesh(Z); % figure % plot3(X,Y,Z) X=70; Y=100; X1=0;Y1=0; X0=X; Y0=Y; z=160; figure(1); plot(X,Y,’r*’), hold on; X=X-xx; Y=Y-yy; TT1 =3*exp(-((X.^2)/78000) -((Y.^2)/20000))-5*exp(-(((X+31).^2)/123) -(((Y+20).^2)/5053)); for i=1:50 z=z/2; X=X-z; Z2 =3*exp(-((X.^2)/78000) -((Y.^2)/20000))-5*exp(-(((X+31).^2)/123) -(((Y+20).^2)/5053)); if Z2>=TT1 TT=Z2; X1=X;…

Continue reading

Impulse signal distortion in transmission line

Today most electronic equipment consists of signal generators and processing units. These units are connected with transmission lines. These lines have big influence in signal distortions. On these lines depends transmition lines stability. Let’s see how transmition lines affect transmitted signals. (G- signal generator; Za– output impedance; I- signal receiver Zb– input impedance; L- transmission line length; Z0– Line impedance. When line is tuned and without losses then input voltage: Ub(t) = ZbE(t-t)/(Za + Zb) E(t)- generators signal amplitude; t– signal delay in line. t =l/v ; l- line lenght; v- signal speed. If line is not tuned up, then there are distortions in line because of reflections in line: If signal E(t) is step function: Then signal in line exit in discrete time moments will be: U(0) = p; U(t) = p*(1+pb) U(2t) = p*(1+pb+pa*pb) U(3t) = p*(1+pb+pa*pb+pa*pb^2); U(4t) = p*(1+pb+pa*pb+pa*pb^2+pa^2*pb^2); U(5t) = p*(1+pb+pa*pb+pa*pb^2+pa^2*pb^2+pa^2*pb^3) … where Depending on reflectance coefficients and their signs distortions can differentiate or integrate: Real model using MathCAD was implemented to see how signal looks like on exit depending on parameters. Below you see used algorithm structure used in modeling: Algorithm Part 1 Algorithm Part 2 One of results using trapezoid signal: In exit we…

Continue reading

Flash vs. EEPROM

There are many questions about Flash and EEPTOM differences. Well these are two different technologies converging together. Flash technology was created to replace mass storage media. Requirements for Flash were minimum power consumption and high number of write cycles. Information written in flash memory is usually in blocks at a time. EEPROM was originally designed to store configuration information or store programs to be boot loaded by microcontrollers or other devices. EEPROMS usually are smaller capacities and can be programmed in smaller information quantities like bytes or bits (serially). Read time is shorter than from Flash but EEPROM has less write cycles. But recently these differences are disappearing as technologies are catching up. So this should explain why in microcontrollers like Atmega128 is more convenient to write data to EEPROM than to Flash. If you would like to store data in flash you would have to rewrite whole sector of 128 bytes in order to store one byte. But if you consider to store bigger information chunks Flash can be good choice too. For more information you might consider reading https://www.embedded.com/98/9801spec.htm

Continue reading

Life-giving to Atmega8

I have got two atmegas from my friend. He stated that they are burned and can be thrown to garbage. He also mentioned that they stopped responding after they were programmed. So I asked him to give those to me to try them. I had in my mind, that this is a result of bad usage of security bits. There is always confusion in these bits, because security bits are programmed by writing ‘0’ values and unprogramed with ‘1’. I didn’t really expected to make them working again as my friend did quite rude experiments with them. What can I say – he was right by saying they are burned. Bu I guess some of you will like to see what I was doing in order to recover them. I decided that he unprogrammed all four security bits ( CKSEL0, CKSEL1, CKSEL2, CKSEL3 )by writing ‘1’ to them. This situation means that Atmega8 has to be clocked from external clock signal. I supposed to program those bits to work atmega normally with quartz resonator.

Continue reading

SkinSeg – segmentation of melanoma

SkinSeg is a simple tool used for skin lesion segmentation. This program was developed by Intelligent Systems laboratory students: L. Xu, M. Jackowski, A. Goshtasby, C. Yu, D. Roseman, S. Bines, A. Dhawan, A. Huntley. Their method is working similarly as in my earlier experiment with the MATLAB pigmented lesion boundary tracing algorithm. The first image is converted to intensity image, and then the lesion edges are detected. ant test results: The more informative description you can find here The program can be downloaded from here: https://www.cs.wright.edu/people/faculty/agoshtas/skinseg.zip  This version of the Skin Cancer Segmentation program (skinseg) runs on the Windows 95/NT platforms. Make sure all files reside in the same directory after extraction. No setup program is required to install skinseg on your machine. To run, execute the program skinseg.exe.

Continue reading

Filter output dependency on tolerance of elements

Sometimes we need to project simple filter with particular characteristics. We usually take calculations with ideal parameters and don’t look on tolerances of them. Let us see how simple filter output depends on its elements tolerances. For this let’s choose simple filter circuit: We are going to calculate filter response characteristics. The band pass frequency is taken on 0.707 level of response. We will see how this frequency depends on electronic elements tolerances. I will model elements with tolerances ±10%.

Continue reading

DullRazor – digital skin hair shaver

DullRasor uses image processing techniques to analyze and segments skin areas with dark hair. This program removes dark hairs form images, and makes skin lesion images clean to further processing.    Many skin images contain various numbers of hairs. Other skin segmentation programs may mislead because of hairs – especially dark ones. One solution can be shaving skin before taking pictures of it. But shaving of skin adds more time to processing, and this is uncomfortable and in some cases unaesthetic.  Hence, a software approach for dark, thick hair removal from skin images is needed.

Continue reading