Convolution: The Edge Problem Solutions are to Redeﬁne convolution at the edge boundary Eliminate edges from the source image by making the source image inﬁnitely large. Speciﬁcally: Convolution is redefined to produce zero when the kernel falls off of the boundary. If the kernel extends beyond the source image when centered on a sample I(x, y) then the output sample is set to zero. Convolution is redefined to produce I(x, y) when the kernel falls off the boundary. If the kernel extends beyond the source image when centered on a sample I(x,y) then the output sample is deﬁned as I(x, y). Extend the source image with a color border. The source image is inﬁnitely extended in all directions by adding zero-valued samples so that samples exist off the edge of the source. This is often referred to as zero padding. Since the source image is inﬁnite in extent, convolution is well deﬁned at all points within the bounds of the unpadded source. Extend the source image by circular indexing. The source image is inﬁnitely extended in all directions by tiling the source image so that samples exist off the edge of the source. Extend the source image by reflective indexing. The source image is inﬁnitely extended in all directions by mirroring the source image so that samples exist off the edge of the source. This mirroring is achieved through the use of reflective indexing.

Merge Sort Analysis Worst-case time complexity for applying the merge function to a size-k subarray: M(k) = 18k-7. template template Etype> void merge(Etype source[], void merge(Etype source[], Etype Etype dest[], dest[], int int lower, lower, int int middle, middle, int int upper) upper) { int int s1 s1 = = lower; lower; int // int s2 s2 = = middle middle + + 1; 1; // 1 1 TU TU int int d d = = lower; lower; do do { if if (source[s1] (source[s1] < < source[s2]) source[s2]) // // If If block: block: { // 14 { // 14 TU TU dest[d] dest[d] = = source[s1]; source[s1]; s1++; s1++; } else else { { dest[d] dest[d] = = source[s2]; source[s2]; s2++; s2++; } d++; // d++; // 1 1 TU TU } while ((s1 <= middle) && // } while ((s1 <= middle) && // k-m k-m iter. iter. (s2 // @ (s2 <= <= upper)); upper)); // @ 3 3 TU TU } } if (s1 > middle) do do { { dest[d] dest[d] = = source[s2]; source[s2]; s2++; s2++; d++; } } while while (s2 (s2 <= <= upper); upper); else else do do { { dest[d] = source[s1]; s1++; s1++; d++; d++; } } while while (s1 (s1 <= <= middle); middle); CS 340 // 1 TU // // // // // // // 6 6 1 1 1 m m TU TU TU TU TU iter. iter. @ @ 1 1 TU TU Time complexity for applying the order function to a size-k subarray: R(k), where R(1)=1 and R(k) = 5+M(k)+2R(k/2) = 18k-2+2R(k/2). This recurrence relation yields R(k) = 18klogk-logk+2. template template void order(Etype source[], Etype dest[], int lower, int upper) { int middle; if (lower != upper) { middle = (lower + upper) / 2; order(dest, source, lower, middle); order(dest, source, middle + 1, upper); merge(source, dest, lower, middle, upper); } } // 1 TU // // // // 3 TU R(k/2) TU R(k/2)+1 TU M(k) TU Time complexity for applying the mergesort function to a sizen subarray: T(n) = 8n+1+R(n) = 18nlogn+8n-logn+3. template void mergeSort(Etype A[], const int n) { Etype Acopy[n+1]; // 1 TU int size; for (int k = 1; k <= n; k++) // n iter. @ 2 TU Acopy[k] = A[k]; // 6 TU order(Acopy, A, 1, size); // R(n) TU } While While this this O(nlogn) O(nlogn) time time complexity complexity is is favorable, favorable, the the requirement requirement of of aa duplicate duplicate array array is is detrimental detrimental to to the the Merge Merge Sort Sort algorithm, algorithm, possibly possibly making making it it less less popular popular than certain alternative choices. than certain alternative choices. Page 16

The efficiency of the drive system The total efficiency of the drive system depends on the losses in the motor and its control. Both drive and motor losses are thermal, so they appear as heat. Input power to the drive system is electrical in form, while output power is mechanical. That is why calculating the coefficient of efficiency (η) requires knowledge of both electrical and mechanical engineering. Electrical input power Pin depends on voltage (U), current (I) and the power factor (cosϕ). The power factor tells us what proportion of the total electric power is active power and how much is so called reactive power. To produce the required mechanical power, active power is required. Reactive power is needed to produce magnetization in the motor. Mechanical output power Pout depends on the required torque (T) and rotating speed (n). The greater the speed or torque required, the greater the power required. This has a direct effect on how much power the drive system draws from the electrical supply. As mentioned earlier, the frequency converter regulates the voltage, which is fed to the motor, and in this way directly controls the power used in the motor as well as in the process being controlled. Electrical switching with transistors is very efficient, so the efficiency of the frequency converter is very high, from 0.97 to 0.99. Motor efficiency is typically between 0.82 and 0.97 depending on the motor size and its rated speed. So it can be said that the total efficiency of the drive system is always above 0.8 when controlled by a frequency converter.

Electromotive Force & Internal Resistance 1. The intrinsic potential difference associated with a power source is referred to as the “electromotive force” or emf a. b. 2. Real power sources are limited in their ability to deliver power output, due to factors such as the maximal rate of the internal chemical reaction, the input power (in an AC plug-in DC power source), etc… a. 3. For a battery, the rate of reaction is dependent on the conditioning and corrosion of electrodes and depletion of internal reactants. This results establishes an effective internal resistance, within the voltage source. As an electrochemical power source is utilized and is run down, the decline in performance output is reflected in the increased in internal resistance a. + In an ideal power source, the voltage across its terminals is its emf For a real power source, such as a battery, the emf is determined by the net electrochemical potential due to its internal redox reaction BUT the actual voltage across its terminals is slightly lower due to its internal resistance (Rint). The output voltage will wane as more of the potential drops across Rint even though the emf remains constant Rint V + - emf -