![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
previous | back | home | next | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CACD Group updated 2000.03.30 Author Janez Puhan | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Triangle to Sine WaveformThe circuitLet us now consider a circuit depicted below, which converts triangular signal waveform to sine waveform. We would like to set the resistances in the circuit so that the purest possible sine signal can be obtained at the output. We will try to solve circuit analytically and calculate the values of the unknown resistors. The first problem is where to choose the break points. The relative error on one section is: assuming b - a < p/2. This result tells us that the best choice are equidistant break points. If we assume ideal diodes with cutin voltage ~ 0.5V and rupi << rupoutj, than resistor values can be calculated (see teble below). Now we will optimise our circuit with the optimize command. Because of symmetry of the circuit we will observe only one half of the circuit in one quarter of a period. In this case we have 12 parameters to optimise rup1 ... rup6, rupout1 ... rupout6. The explicit constraints (see table below) are set around analytically calculated values. There are no implicit constraints. Let the cost function be defined as normalised square area between the real and ideal response: It is a positive scalar and the circuit with ideal sine response would have its value zero. The initial point of optimisation method is approximately the center of the explicitly constrained parameter space. Table 1: Resistor values (all values are rounded)
We ran the optimisation with different optimisation methods from the same initial point. The parameters of all methods were set to their default values. So results (see table below) with the particular method could be improved by fine tuning method parameters. Anyway we can see that gradient methods have local character. They are quickly trapped in a local minimum, which can be just a consequence of numerical noise. Random and genetic algorithm search across whole parameter space but they need a lot of iterations to get satisfying results. Direct search methods performed better. Hooke-Jeeves's method was the best among direct search methods for this example. On the other hand Powell's method converged very fast. Time needed for optimisation was measured on 200Mhz Pentium personal computer running Windows 95. Optimal parameter values obtained by Hooke-Jeeves's method are shown in the table above. Table 2: Optimisation statistics
To check if we improved analytically calculated circuit, we will take a closer look after the harmonic distortion of the output signal. We can see (table below) that optimisation method starting from initial circuit, which is worse than analytical circuit, gave better results than analytically calculated. The reason is in taking real diodes into account instead of ideal diodes in analytic circuit. Table 3: Harmonic distortion (normalised magnitudes)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
previous | back | home | next |