# Improve Magnetic Card Reading in the Presence of Noise

Abstract: Most magnetic read head data sheets do not fully specify the frequency-dependent components and are often vague when specifying other key parameters. In some cases, the specifications of two very similar heads from two different manufacturers might be quite different in terms of parameters specified and omitted. The limitations in the data sheets make designing an optimum card reading system unnecessarily difficult and time consuming. This document outlines a strategy to overcome the above shortcomings and offers guidelines to overcome the noise issues.

## Introduction

## Magnetic-Stripe Card Basics

**Figure 1**shows a magnetic stripe card with three tracks. Several ISO/IEC¹ standards define important card properties such as the physical size, exact location of the stripes, magnetic properties, and magnetic track data structures. Track 1 standards were created by the International Air Transportation Association (IATA). Track 2 standards were created by the banking industry (American Bankers Association, ABA), and Track 3 standards were created by the thrift-savings industry.

*Figure 1. A magnetic stripe card.*

**Figure 2**, the binary data is encoded along the track by magnetizing stripe areas with different polarities. The polarity of the transitions is arbitrary, since only the

*relative space*between the transitions implies a binary 1 or a binary 0.

*Figure 2. F2F encoding and decoding waveforms.*

_{0}and f

_{1}, where f

_{0}is the fundamental of the square wave for binary 0, and f

_{1}= 2f

_{0}is the fundamental of the square wave for binary 1. Hence, the name F2F. The average amplitude of the binary 0 waveform is twice that of the binary 1 waveform, A

_{0}= 2A

_{1}.

**Figure 3**shows the combined spectrum of F2F encoded binary 0s and 1s normalized to f

_{0}. Note that most of the signal energy resides between f

_{0}and 3f

_{0}. Thus, to get a good approximation of a rectangular waveform containing a series of F2F encoded binary 1s and 0s, it is enough to recover the two fundamentals (f

_{0}and f

_{1}) and the 3rd harmonic of f

_{0}.

*Figure 3. Spectrum of F2F-encoded binary 0 and 1.*

_{0}. However, we can see from Fourier analysis that the amplitudes of these components decrease very quickly for decreasing frequencies. Thus, a bandwidth from 0.5f

_{0}to 3f

_{0}is adequate for recovering an F2F-encoded rectangular waveform.²

_{0}and f

_{1}, we need to know the swipe speed range and the track recording density. From ISO/IEC standards, the recording density of Tracks 1 and 3 is 210 bits/in (8.27 bits/mm), while that of Track 2 is 75 bits/in (2.95 bits/mm).

_{0,min}we take the slowest swipe speed supported and multiply it by the Track 2 density numbers. For f

_{1,max}we pick the fastest swipe speed supported and multiply it by the density of Tracks 1 or 3.

_{0}and f

_{1}values is calculated as follows:

- Tracks 1 and 3: f
_{0,min}= 0.42kbps and f_{1,max}= 42kbps - Track 2: f
_{0,min}= 0.15kbps and f_{1,max}= 15kbps

_{0,min}and f

_{1,max}will become clear once we have the MRH model and study its transfer function.

## Fundamentals of Magnetic Read Heads and Card Readers

E() = open-circuit voltage

K = a constant relating the effects of magnetic-stripe velocity, head width, and the number of coil turns in the MRH

H(x, y) = field function of the read head

M[(x - ), y] = magnetic-stripe material magnetization

y

_{1}= spacing from the head to the top of the magnetic-stripe

y

_{2}= spacing from the head to the bottom of the magnetic-stripe

_{h}, and one capacitive element, C

_{h}. In real systems some energy is always spent during the transformation. Thus, the model must also contain a resistive element, R

_{h}. In practice, an MRH will not only have C

_{h}across its two terminals, but it will also have an external impedance, Z

_{o}, from, for example, connecting wires, PCB traces, IC pins, probes, etc.

*n*th harmonic frequency, f

_{n}, is shown in

**Figure 4a**, which then is simplified as

**Figure 4b**.

^{3, 4, 5}The transfer function of the 2nd-order circuit in Figure 4b is easily calculated as:

*Figure 4. Equivalent MRH model.*

**Table 1**lists the key specifications that are needed for the model of Figure 4b. Notice the different amount of detail. While both Manufacturers A and C specify several electrical parameters, Manufacturer B specifies only one: peak-to-peak head readout level.

Table 1. Manufacturer Specifications for a Magnetic Head | |||

Parameter | Manufacturer A | Manufacturer B | Manufacturer C |

V_{O(P-P)} (mV) |
20 | 19 | 35 |

L_{h} (mH) |
25 | — | 110 |

C_{h} (pF) |
— | — | — |

R_{h} (Ω) |
110 | — | 280 |

**Head Inductance (L**How does L_{h})._{h}behave over a larger frequency range? How does L_{h}behave when carrying currents other than what is specified?**Head DC Resistance (R**What voltage level is applied across the head terminals?_{h}).**Head Read Output Level (V**What type of test card is used? What is the card swipe speed? What is the load across the head?_{O(P-P)}).**Head Capacitance (C**What is the capacitance between the two head terminals? Does it change with frequency?_{h}).

^{6, 7}use standard forms to write equations. One standard uses the form:

_{o}² = 0

α is the damping attenuation:

ω

_{o}is the resonance frequency:

_{o}, the roots of the natural response can be

*real*,

*complex*, or

*imaginary*. For readers who are familiar with other standard forms, we now define the damping factor as ζ = α/ω

_{o}(note: quality factor Q = 1/2ζ) and use the other standard form:

_{o}× s + ω

_{o}² = 0

**Figure 5**shows the settling behavior for various ζ values when a step is applied at t = 0. Specifically, the settling behavior is categorized as follows:

ζ < 1 underdamped

ζ = 1 critically damped

ζ = 0 undamped or oscillatory

*Figure 5. MRH output voltage for various ζ values.*

*underdamped*system ringing occurs, which can cause reading errors due to false peaks and false zero crossings. However, if the system is drastically

*overdamped*, timing errors can occur from slow settling and reading errors can occur from shifts in the peaks. After analyzing an MRH's time-domain behavior, we next look at its frequency-domain behavior.

**Figure 6**shows the frequency response of the transfer function, T

_{n}(s), which is normalized to its resonance frequency, ω

_{o}. We observe peaking as we approach the system resonance frequency. This is due to the intrinsic nature of the circuit shown in Figure 4b, i.e., a parallel RLC. Depending on the swipe speed, this peaking can also cause reading errors.

*Figure 6. Transfer function's frequency response.*

_{0}and f

_{1}, and at least the 3rd harmonic of f

_{0}. From Figure 3 we see that most of the signal energy is in the vicinity of 0.5f

_{0}to 3.5f

_{0}, while a small portion is around 6f

_{0}.

**Figure 7**, which mathematically shows MRH output voltage for two different gains at higher harmonics: solid blue is the unity gain and red for a gain of two. The dotted black lines are the ZX hysteresis limits. Clearly, as the gain doubles, the MRH output signal in red shows more distortion, false peaks, and zero crossings.

*Figure 7. Distortion in MRH output voltage due to gain peaking.*

## Characterizing Various Read Heads

^{®}Secure Microcontroller (MAXQ1740). As 12MHz is the maximum system clock frequency for the MAXQ1740, each MRH was characterized from 100Hz to 12MHz (100Hz is analyzer's limit).

**Table 2**shows parameter averages for triple-track MRHs.

Table 2. CKT-B Parameters for Triple-Track MRHs | ||||

Parameter | MRH 1 | MRH 2 | MRH 3 | MRH 4 |

L_{h} (mH) |
13.67 | 58.09 | 13.20 | 57.43 |

C_{h} (pF) |
22.15 | 31.11 | 20.60 | 16.97 |

R_{h} (Ω) |
146.78 | 234.57 | 145.72 | 214.51 |

## Analyzing the Measured Parameters

_{h}~ 3.6%, ΔR

_{h}~ 0.7%, and ΔC

_{h}~ 7.5%. For MRH 2 and MRH 4, the relative differences in their parameters are: ΔL

_{h}~ 1.2%, ΔR

_{h}~ 9.4%, and ΔC

_{h}~ 83%. Since C

_{h}affects both α and ω

_{o}, for similar conditions we can expect the behavior of MRHs 1 and 3 to be very similar. We can expect the behavior of MRHs 2 and 4 to track below their resonance frequencies, but then change as the frequencies reach close to, and beyond, their respective resonance points.

**Figure 8**. The load in Figure 8 is 1G that results in a damping ratio of 0.03. The plots for MRHs 1 and 3 are virtually the same, while the plots for MRHs 2 and 4 show increasing differences around the resonance frequencies. The increase in magnitude could result in reading errors, as described earlier.

*Figure 8. MRH transfer function vs. frequency with a 1GΩ external load (ζ = 0.03).*

**Figure 9**shows MRH transfer functions for the frequency range of 150kHz to 300kHz, i.e., 3rd and 6th harmonics corresponding to the maximum card-swipe rate of 100in/s (254cm/s). We can see that as the swipe rates increase, so do the MRH transfer-function magnitude values. The main concern here is that if higher harmonics are gained up beyond a point, false zero crossings and peaks can occur as shown in Figure 7. Also, if signals larger than the maximum allowed appear at the interface between the head and the card reader's inputs, then reading errors might occur.

*Figure 9. MRH transfer function vs. 3rd and 6th harmonic frequency range.*

**Figure 10**shows the transfer function plots for three arbitrarily different external loads values: 100kΩ, 10kΩ, and 1kΩ. We see in Figure 10 that for lower-value external resistors, the peaking is reduced compared to that shown in Figure 9. Note that for 1kΩ loads the gain at the 3rd harmonic is severely reduced for all four MRHs. This can be a problem. With 100k loads, for MRHs 2 and 3, the gains peaks at the 3rd harmonic, while for MRHs 2 and 3, the gain peaks at the 6th harmonic. The main point here is that we cannot arbitrarily pick the R

_{o}values.

*Figure 10. MRH transfer function for different external load values.*

_{o}across the MRH terminals, it is very important to ensure that the damping ratio, ζ, stays as close to the unity as possible.

**Figure 11**plots ζ vs. R

_{o}for the four characterized MRHs. For ζ = 1, we need R

_{o}≈ 12kΩ for both MRHs 1 and 3; R

_{o}≈ 22kΩ for MRH 2; and R

_{o}≈ 28kΩ for MRH 4.

**Figure 12**shows that transfer function with optimum load values. Comparing Figure 12 to Figure 10, we note that the gain does not peaking at the 3rd harmonic and stays close to unity.

*Figure 11. MRH damping factors (ζ) vs. external resistor (R*

_{o}).*Figure 12. MRH transfer functions for optimal external loads.*

_{o}is set by ζ = 1, the minimum R

_{o}value depends on the minimum signal supported and the head DC resistance, R

_{h}. As a general rule, keep R

_{o}≥ 5R

_{h}so that R

_{o}in parallel with R

_{h}will not attenuate the head output signal by more than 20%.

_{o}. Therefore, limit this peaking for the range corresponding to the 3rd and the 6th harmonics of card swipe rate, e.g., 150kHz to 300kHz for the card swipe-rate range of 42kHz to 50kHz. Second, the system behavior can be adjusted by placing R

_{o}across the head reader's terminals. Changing R

_{o}changes the damping ratio, ζ. Finally, select R

_{o}value to make the system critically damped and let the lead wiring and PCB routing set the C

_{o}value.

## Optimizing Card Reading

**Step 1**. Choose an R

_{o}value to get an appropriate damping ratio and limit the gain peaking.

- In general, the target should be a
*critically damped*to slightly*overdamped*system. As an exception, if for some cases the gain at the 3rd harmonic drops below half, then we can equalize the gain by a slightly underdamped system. - An
*underdamped*system can introduce noise from ringing of the input signal. Ringing noise adversely affects the ZX, but may also result in false peaks due to gain peaking. - Keep R
_{o}≥ 5R_{h}with the maximum R_{o}set by ζ = 1.

**Step 2**. On noisier printed circuit boards (PCBs) it helps to make the system

*overdamped*, especially Track 2 (T2).

- T2 has 40 numeric digits, as opposed to 79 alphanumeric characters for T1/T3.
- On T2 longer gaps exist between the peaks where noise can affect ZX.
- Overdampening integrates the T2 signal. The signal approaches a saw-tooth waveform, as shown in
**Figure 13**. Overdampening helps the ZX by filtering out high-frequency glitches. - Keep R
_{o}≥ 5R_{h}so that the head attenuation stays under 20%. **A note of caution**: an excessively overdamped system can lead to errors due to slow settling and peak shifts.

**Step 3**. If using less expensive, but noisier read heads, overcome the noise by reducing the input signal without affecting the damping ratio.

- Choose an appropriate R
_{o}. - Divide R
_{o}into smaller segments so that the total R_{o}remains the same as in Step 1. - Use the appropriate tap to the get the required signal division.
- There are several ways to do this, as described in the Practical Examples section below.

**Step 4**. When the read head output on the MAXQ1740 exceeds 300mV

_{P-P}, internal clipping of the signal occurs. This clipping can also cause reading errors.

- Use the method described in Step 3 to reduce the signal.

## Practical Examples

### Input Signal and Noise Reduction

_{o}.

**Goal**: achieve a 25% reduction in the signal.

- Use one 0.25 × R
_{o}and one 0.75 × R_{o}in series across the head. Then 0.75 × R_{o}is tied to the head common-pin side. Tie the midpoint to the input. - Use four 0.25 × R
_{o}in series across the head. Tie the midpoint to the input.

**Goal**: achieve a 75% reduction in the signal.

- Use one 0.25 × R
_{o}and one 0.75 × R_{o}in series across the head. Then 0.25 × R_{o}is tied to the head common-pin side. Tie the midpoint to the input. - Use four 0.25 × R
_{o}in series across the head. Tie one tap above midpoint to the input.

## Effects of Damping Factors

**Figure 13**shows the overdamped behavior, while

**Figure 14**shows the critically damped behavior. Comparing Figures 11 and 12, we note the slow settling and peak shifts for the overdamped case compared to the critically damped behavior. Both slow settling and peak shifts can cause timing errors resulting in reading errors as described earlier.

*Figure 13. Overdamped response. T2 for a manual swipe with 40% card and R*

_{o}= 1.5kΩ.*Figure 14. Critically damped behavior. T2 for a manual swipe with 40% card and R*

_{o}= 13.5kΩ.## Conclusions

*underdamped*system reading errors can occur due to false peaks and false zero crossings. Both ringing and excessive gain peaking (around the 3rd and 5th harmonics of the swipe speed) can produce false peaks and zero crossing. Conversely, if the system is drastically

*overdamped*, timing errors can occur because of peak shifts.

*critically damped*and then tap the MRH output from an appropriate node to divide down the MRH output level.

#### Acknowledgements

#### References

- ISO/IEC 7810, ISO/IEC 7811, ISO/IEC 7812, ISO/IEC 7813. For more information and the standards, visit www.iso.org/iso/search.htm?qt=identification+cards&searchSubmit=Search&sort=rel&type=simple&published=on.
- Cuccia, C. L.,
, McGraw-Hill, New York, 1952.*Harmonics, Sidebands and Transients in Communication Engineering* - Hoaglaind, A. S.,
, Wiley, New York, 1963.*Digital Magnetic Recording* - Chu, W. W.,
*Computer Simulations of Waveform Distortions in Digital Magnetic Recordings*,**IEEE® Transactions on Electronic Computers**, Vol. 15, pp. 328–336, Jun. 1966. - Chu, W. W.,
*A Computer Simulation of Electrical Loss and Loading Effect in Magnetic Recording*,**IEEE® Transactions on Electronic Computers**, Vol. EC-16, No. 4, pp. 430–434, Aug. 1967. - Nilsson, J.W.,
, 3*Electric Circuits*^{rd}ed., (Reading, MA, Addison-Wesley Publishing C_{o}.), 1990. - VanValkenger, M.E.,
, 3*Network Analysis*^{rd}ed., (Englewood Cliffs, NJ Prentice-Hall), 1974.