WO2001011918A2 - Compensation system and method for sound reproduction - Google Patents

Compensation system and method for sound reproduction Download PDF

Info

Publication number
WO2001011918A2
WO2001011918A2 PCT/US2000/021916 US0021916W WO0111918A2 WO 2001011918 A2 WO2001011918 A2 WO 2001011918A2 US 0021916 W US0021916 W US 0021916W WO 0111918 A2 WO0111918 A2 WO 0111918A2
Authority
WO
WIPO (PCT)
Prior art keywords
response
filters
value
afx
frequency
Prior art date
Application number
PCT/US2000/021916
Other languages
French (fr)
Other versions
WO2001011918A3 (en
Inventor
Mats Myrberg
Alex Limberis
Timothy E. Onders
Keith O. Johnson
Original Assignee
Pacific Microsonics, Inc.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Pacific Microsonics, Inc. filed Critical Pacific Microsonics, Inc.
Priority to JP2001515654A priority Critical patent/JP2003506984A/en
Priority to AU69009/00A priority patent/AU6900900A/en
Publication of WO2001011918A2 publication Critical patent/WO2001011918A2/en
Publication of WO2001011918A3 publication Critical patent/WO2001011918A3/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R5/00Stereophonic arrangements
    • H04R5/04Circuit arrangements, e.g. for selective connection of amplifier inputs/outputs to loudspeakers, for loudspeaker detection, or for adaptation of settings to personal preferences or hearing impairments
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R25/00Deaf-aid sets, i.e. electro-acoustic or electro-mechanical hearing aids; Electric tinnitus maskers providing an auditory perception

Definitions

  • This invention relates generally to a compensation method and system for use in sonic transmission and reproduction systems and more particularly to a compensation method and system that uses parametric values to control or adjust processes having transforms or models with properties or responses like the components or elements used in the transmission or reproduction system.
  • Models consolidate technical languages and are usually intended to imitate or simulate the acoustic responses of the speaker system from electrical stimulus. Model creation or synthesis frequently begins by making functional groupings of elements which collectively represent or behave like all or part of the speaker. Coil and magnet parts become motors, which are represented by resistors, inductors, capacitors, back EMF generators and other transformed parts. A combination of factors such as air volume, moving mass, acoustic loading, magnetic-braking, and mechanical losses might be analyzed and simplified to LCR resonator networks or circuits.
  • the transformed electromechanical, acoustic, and mechanical representations expressed in the model are further simplified or reduced to fewer elements.
  • the model still responds like the speaker, but the parts making the model no longer have exact behavioral equivalence to the parts making the speaker. Consequently, traditional models are neither intended, nor capable of making parametrically addressed zero-phase compensations when speaker parts are changed.
  • the technique does work to a fashion, but its dedicated, inflexible circuitry or specialized process tied to the traditional model limits its use to a one-speaker design.
  • Some high-quality crossover networks constructed to divide the signal spectrum amongst multiple drivers may have some conjugate response correction like this.
  • a low-frequency resonant boost is intentionally designed for most speakers. Frequently, traditional models are made to represent quantifiable and predictable acoustic behavior as well as other speaker design factors affecting bass response. Mechanical construction and properties of air determine frequency, resonant losses and the configuration's effect on acoustic output from the speaker. A good approximation to a zero-phase conjugate or same-order correction for a wider frequency range can be designed and implemented in this manner. Several components are needed to match the resonant behavior, but all interact with each other when adjustments are made for a different speaker of similar concept and design.
  • a human operator can assume an alignment role by adjusting a graphic equalizer, manually tuning a parametric filter, or changing settings to a crossover device.
  • Commercial analog components perform these functions, but they have limitations.
  • Graphic equalizers have up to 31 bands or resonators, parametric devices include several adjustable filters and a few have variable crossover and shelf functions. Many more filters are needed.
  • Combinations of graphic and parametric equalizers are incapable of providing a large enough number of points, nor the exact phase and time response to effectively compensate complex behavior from a loudspeaker. Either the corrections do not match specific frequencies, thereby creating phase error, or the number of filters is inadequate to deal with settling time and standing wave issues. Group delay distortion, time-phase error, incomplete correction and other shortcomings are likely to outweigh other improvements.
  • DSP filters can create many more filter sections than is practical from analog circuits.
  • Graphic equalizers made up with parametrically controlled sections have been used with specialized control-generating software to create room response leveling. Such processes are difficult to set up because the room interferes with the identification of important behavioral indicators. Without their input, conjugate response corrections are not possible. Standing wave and nodal distortion corrections could be made from such a system. However, the awkward compiling and processing needed to parametrically move the compensated notches would be difficult. Most likely, a single point response pickup and FFT has been used for data input to the system. Such methods cannot respond to or provide the time-phase information needed to create a true conjugate response to the speaker.
  • DSP systems can economically create many parametric filters and time-related processes that are impractical with analog circuitry.
  • Traditional large-scale DSP systems have little means to identify and cull out speaker behavior from other measurement anomalies. Their frequency-domain responses are likely to add phase errors and to overlook delayed settling energy. The sound might improve for one listening position but it will degrade for all others. More likely, the reproduced sound will change without definitive improvement.
  • those concerned with the reproduction of sound have recognized the need for a system and method of modeling the complete behavior of sound reproduction devices such that conjugate responses to the sound reproduction device responses may be created.
  • the need for a system and method employing modifiable conjugate response has also been recognized.
  • the need has also been recognized for a system and method that compensates the reproduction of sound independent of the environment in which the sound is to be heard.
  • the present invention fulfills these needs and others.
  • the present invention provides a system and method for modeling individual response characteristics of a sonic reproduction device to create a conjugate model for improving frequency, time, phase, and amplitude performance of the device and to provide improved sonic balance, sound clarity, reduced distortion and improved stereo imaging.
  • the invention in a first aspect, relates to an apparatus for modifying an electrical audio signal for input to a sonic reproduction device characterized by a plurality of individual responses.
  • the individual responses of the device combine to define an overall response.
  • Each individual response includes one or more of a frequency, time, phase or transient response.
  • the apparatus includes a plurality of modification filters having modification responses that simulate the plurality of individual responses of the sonic reproduction device.
  • the modification filters receive the electrical audio signal, modify the electrical audio signal and provide the electrical audio signal to the sonic reproduction device.
  • the apparatus further includes a plurality of adjustable parameters. Each of the adjustable parameters is associated with at least one of the modification filters.
  • the adjustable parameters allow for adjustments to the responses of the modification filters.
  • the adjustments create a plurality of individual conjugate responses.
  • Each individual conjugate response is associated with at least one of the plurality of individual responses.
  • the system allows for the creation of conjugate responses that provide specific opposing or correction responses to the response of the reproduction device.
  • the plurality of individual responses of the sonic reproduction device are related to at least one of mechanical, acoustic and electromagnetic behavior of the sonic reproduction device.
  • the plurality of modification responses combine to form an overall response that is a conjugate to the overall response of the sonic reproduction device.
  • at least one of the modification filters comprises a cut-off filter and the parameters for adjusting the frequency response of the cut-off filter include peak frequency, amplitude and Q parameters.
  • at least one of the modification filters comprises a constant slope equalizer and the parameters for adjusting the frequency response of the constant slope equalizer include crossover frequency and boost shelf parameters.
  • At least one of the modification filters comprises a parametric notch filter and the parameters for adjusting the frequency response of the parametric notch filter include notch frequency, amplitude and Q parameters and at least one of the modification filters comprises a parametric notch-boost filter and the parameters for adjusting the frequency response of the parametric notch-boost filter include notch frequency, amplitude and Q parameters.
  • the invention in a second aspect, relates to a sound compensation system for altering an electrical audio signal for input to a sonic reproduction device having associated behavioral characteristics.
  • the system includes a model of the sonic reproduction device.
  • the model includes a plurality of filters or processes that simulate at least one of the behavioral characteristics of the sonic reproduction device.
  • Each filter has an associated response that combine to define an overall response for the model.
  • Each individual response includes one or more of a frequency, time, phase or transient response.
  • the system also includes a controller that modifies the response of each of the plurality of filters to transform the filter into a conjugate filter.
  • Each conjugate filter has a response that is a conjugate to the original response of the filter or process.
  • the behavioral characteristics are defined by individual or groups of individual components of the sonic reproduction device.
  • individual compensations for these characteristics can be created and manipulated parametrically. Therefore, these same compensations can be applied to additional systems having similar components or characteristics.
  • the filters are defined by digital signal processes or by analog circuits and the controller includes a computer or adjustable circuit components.
  • the sonic reproduction device comprises a speaker and at least one of the plurality of filters includes at least one associated adjustable parameter and the value of the parameter is calculated based on physical characteristics of the speaker, derived from a standard speaker model or determined experimentally using standard test measurements.
  • the controller is configured such that an adjustment in the setting of one parameter modulates the setting of at least one other parameter.
  • the controller monitors the program conditions at the sonic reproduction device and sets at least one of the parameter values based on the program conditions.
  • the invention in a third facet, relates to a sound system.
  • the sound system includes a sonic reproduction device having associated mechanical, acoustic and electromagnetic behavioral characteristics.
  • the sound system also includes a source for outputting an electrical audio signal to a model of the sonic reproduction device.
  • the model includes a plurality of filters that simulate at least one of the mechanical, acoustic and electromagnetic behavioral characteristics of the sonic reproduction device. Each filter has an associated response that includes at least one of a frequency, time, phase or transient response.
  • the model outputs the electrical audio signal to the sonic reproduction device.
  • the sound system further includes a controller that modifies the responses of the filters to transform the model into a conjugate model having a plurality of filters with responses that comprise conjugates to the original response of the filter.
  • the invention in a fourth aspect, relates to a method for modifying an electrical audio signal for input to a sonic reproduction device that is characterized by a plurality of individual responses which in combination define an overall frequency response for the sonic reproduction device.
  • Each individual response includes one or more of a frequency, time, phase or transient response.
  • the method includes the steps of simulating the plurality of individual responses with a plurality of filters and adjusting the responses of the plurality of filters such that, for each filter, the adjusted response comprises a response that is a conjugate to one of the individual responses.
  • the method further includes the step of inputting the electrical audio signal to the filters.
  • At least one of the filters comprises a cut-off filter and the step of adjusting the frequency response of the cut-off filter includes the step of setting at least one of peak frequency, amplitude and Q.
  • at least one of the filters comprises a constant slope equalizer and the step of adjusting the frequency response of the constant slope equalizer includes the step of setting at least one of crossover frequency and boost shelf.
  • at least one of the filters comprises a parametric notch filter and the step of adjusting the frequency response of the parametric notch filter comprises the step of setting at least one of notch frequency, amplitude and Q.
  • At least one of the filters comprises a parametric notch-boost filter and the step of adjusting the frequency response of the parametric notch-boost filter comprises the step of setting at least one of notch frequency, amplitude and Q.
  • the invention in a fifth facet, relates to a method of altering an electrical audio signal for input to a sonic reproduction device having associated behavioral characteristics.
  • the method includes the step of simulating at least one of the behavioral characteristics of the sonic reproduction device with a plurality of filters.
  • Each of the filters has an associated response comprising at least one of a frequency, time, phase or transient response.
  • the method further includes the step of, for each of the filters, modifying the response of the filter to transform the filter into a conjugate filter having a response that comprises a conjugate to the original response of the filter.
  • the sonic reproduction device comprises a speaker
  • at least one of the plurality of filters has at least one associated adjustable parameter
  • the step of modifying the response of the filter includes one or more of the following pairs of steps calculating the value of the adjustable parameter value based on the physical characteristics of the speaker and setting the parameter to the calculated value, deriving the adjustable parameter from a standard speaker model and setting the parameter to the denved value and determining the adjustable parameter expenmentally using standard test measurements, and setting the parameter to the determined value.
  • the method further includes the step of modulating the setting of at least one parameter in response to the setting of another parameter.
  • the method further includes the steps of momto ⁇ ng at least one program condition at the sonic reproduction device and setting at least one of the parameter values based on the program condition.
  • FIG. 1 is a block diagram of a sonic reproduction system incorporating a compensation system in accordance with the invention
  • FIG. 2 is a block diagram of a compensation system having a plurality of modification filters, each having a plurality of adjustable parameters for modifying one or more of the frequency, time and phase responses of the filters,
  • FIGS. 3a-3b depict a plurality of response components for a loudspeaker
  • FIG. 3f depicts the overall response formed when combining the individual responses of FIG. 3a-3e
  • FIGS. 4a-4e depict a plurality of adjustable modification responses for a compensation system, each response is adjustable to form a conjugate response to the response components of FIGS. 3a-3e;
  • FIG. 4f depicts the overall conjugate response formed when combining the individual frequency responses of FIGs 4a-4e;
  • FIG. 5 is a graph depicting the motion for a circular cone to produce one acoustic watt output
  • FIG. 6 depicts the frequency responses for two small loudspeaker drivers
  • FIG. 7 depicts a waterfall plot wherein the arrows at the right show the increasing time axis
  • FIGS. 8a-8f depicts a series of graphical user interfaces for adjusting parametric controls for modifying the responses of the modification filters
  • FIG. 9 is a schematic of an low-pass/high-pass peaking filter, where all Cs must change to move frequency;
  • FIG. 10 is a schematic of an active RC or constant slope equalizer that boosts and has approximate parametric independence, where Cc and Re are both very large to bias the op amp;
  • FIG. 11 is a schematic of a frequency movable notch
  • FIG. 12 is a schematic of an alternate configuration of a frequency movable notch
  • FIG. 13 includes a schematic diagram of a weighted notch filter and the responses for boost, and notch components and a combined response, obtainable using the filter,
  • FIG. 14 includes a schematic diagram of a multi-resonant weighted notch filter and the responses for boost and notch components and a combined response obtainable using the notch filter;
  • FIG. 15 depicts the frequency, and phase responses for a notch filter
  • FIG. 16 is a schematic of a delayed interference simulator/compensator where CW equals the same response as interference, CCW equals a conjugate correction and RC equals a decrease compensation for higher frequencies;
  • FIG. 17 is a schematic of an all-pass or phase shift network.
  • the system 10 includes a signal source 12, for providing an electrical audio signal.
  • the signal source may be, for example, a CD player.
  • the output 14 from the signal source 12 is input to a compensation system 16 which employs detailed features and aspects of the present invention.
  • the output 14 is processed by the compensation system 16 to produce a compensated electrical audio signal 18 which is fed to a power amplifier 19 and a loudspeaker 20.
  • the compensation system 18 employs a plurality of filters 24 which, either individually or in combination, exhibit individual compensation responses which simulate the frequency, time and phase responses exhibited by the various mechanical, acoustic and electromagnetic components of the loudspeaker.
  • the filters 24 are created using DSP or analog circuits.
  • Digital signal processing is the preferred implementation, since analytical models of loudspeaker behavior translate easily to the mathematical synthesis techniques used for designing digital systems. Analog circuits have distortion build-up in cascade architectures. Therefore, a practical analog implementation of the compensation system 18 is possible only when the analog designer is aware that parallel-connected circuit elements can be used when behavioral responses are isolated and non-interactive.
  • Some parameter 22 adjustments interact with one or more parts of the compensation system.
  • a digital implementation provides the ability to utilize a compilation of possible settings or to calculate these relationships as needed. When the compensation system is controlled from a computer the setup adjustments appear simple and intuitive.
  • Each of these computed and adjustable compensation responses can be scaled to a parametrically variable, feature, or design aspect, relating to size, a moving property, or acoustic radiation behavior, amongst other things.
  • Time delays, maximum excursion limits, wavelength relationships, nodal and standing wave frequencies, boundary reflections and like properties of the speaker can be adjusted and used by the compensation system.
  • the compensation system uses minimum-phase equivalence and strings of non-interacting filters.
  • FIG. 3f A typical overall response for a small speaker is shown in FIG. 3f. The same response is repeated at the top of FIG. 4.
  • Figures 3a-3e shows a plurality of individual responses related to speaker components which combine to produce the overall response curve.
  • Figures 4a-4e show a plurality of individual compensation responses which are adjusted via a plurality of adjustable parameters, e. g. , L s , H s , L x , H x , etc., to produce a plurality of conjugate responses. Properties of the parameters are described in detail below.
  • the individual conjugate responses combine to produce or an overall conjugate response .
  • the combination of the overall speaker response (FIG. 3f) and conjugate response (FIG. 4f) produce a smooth response. From FIGS. 3a and 4a, the first and second cutoff inflections for both high and low frequencies are evident.
  • Self-resonance of the driver operating in its enclosure can be measured or calculated to yield W 0 .
  • 0 settings can be experimentally measured or calculated from traditional models, provided the acoustic coupling factor has been removed.
  • Figures 3d and 4d show this bass compensation.
  • FIGS. 3d and 4d show that acoustic response error and coloration from W, can be removed by setting
  • a surround resonance is noted and a preset or default Q can be chosen to compensate a resonant behavior model typical of loudspeaker materials involved.
  • a slope or tilt EQ is added to achieve a best listener preference.
  • Figures 3c and 4c show behavior and correction. Additional downward tilt might be added for subjective balance. As can be seen, approximately 12 to 16 adjustments, each spanning as few as 8 bits of resolution, can make a very good conjugate correction. Representative frequency responses from two loudspeaker driver units are shown in FIG. 6. Note that, as indicated by the roll off of the response curve at the low end, the W 0 and second inflection response related to L P are missing because the driver operates in a very large enclosure. Other than this, the other parametrically related features are evident and adjustments can be worked out from these curves.
  • the following parameters allow for the creation of, simulations of, or conjugates to, the complex frequency, phase, and time responses of a loudspeaker.
  • These adjustable parameters 22 and their operations can approximate zero-phase response, extend bass output, and remove mechanical sounds from a speaker (other parameters can be used in a similar manner).
  • the individual compensations can be performed digitally or using active or passive analog circuits, such as RC circuits, analog resonators, or fully parametric circuits like state- variable filters or biquads.
  • Low Crossover Lv or Acoustic Coupling - Low frequency output depends on the size of radiating surfaces.
  • the 6dB-per-octave loss from this relationship is inherently compensated by increased cone motion provided the back voltage from the motor structure is small compared to the driving signal. If compliance were infinite and the motor produced force without velocity restriction, this idealized configuration would have flat response.
  • Real systems having air volumes, mechanical stiffness, and velocity limits have two practical crossover points where the response breaks from flat and converges to 6dB/octave and then to 12dB/octave bass loss. Usually, the second inflection is near the lowest useful response of the loudspeaker and often becomes impractical to compensate.
  • the control parameter for this compensation is frequency in Hz and the conjugate response (specific compensation) is a +6dB/octave boost for decreasing frequency.
  • This boost starts at the first response inflection from the speaker.
  • the value for this parameter can be measured by applying a test signal, e. g. , sine wave, to the speaker and measuring the response.
  • the value may also be calculated based on physical characteristics of the speaker such as cone and coil mass.
  • the value may also be derived from a speaker model such as a standard Theil/Small model which is generally provided by the speaker manufacturer.
  • High Crossover (H x ) or Mass-Compliance Factor - High frequency output depends on the size and velocity of the radiating surfaces. Usually, the wavelengths of interest for frequencies near cutoff are small compared to the motional part of the speaker creating the output. Stiffness and damping properties of the cone material affect this transition from whole surface radiation at lower frequencies. Higher frequencies radiate nearer the voice coil. Moving mass eventually creates a 6dB/octave reduction of motion with increasing frequency. Leakage inductance from the motor assembly adds further compliance to the system to create a second inflection making a 12dB/octave drop at the highest practical frequencies. These losses, combined with decreased radiating area, create a reduction of acoustic output.
  • the control parameter for this compensation is frequency in Hz, and the conjugate response is a 6dB/octave boost with increasing frequency.
  • the value for this parameter can be measured or calculated in a manner similar to that previously described for low crossover.
  • Low Boost Shelf (L s ) - Maximum boost from L s is restricted to practical maximum limits from the amplifier power, cone motion, voice coil length, enclosure size, and intended bass extension. These requirements conflict and interact, e. g., longer voice coils require bigger amplifiers and suspension parts. For example, an extended coil can provide greater linear excursion and bass output potential, but efficiency decreases unless flux energy from the magnet is increased.
  • L s parameter can be made to change or track different volume control settings and program dynamics, so that the speaker system can operate near its maximum capability for a wide range of conditions.
  • the L s parameter is affected by design and construction factors, which include radiation area, compliance, and force factor of the driving motor.
  • the modeled parameter can track changes to these factors with very little interaction.
  • the L s parameter is +/- dB.
  • the L s parameter setting can be determined by experimenting with compromise tradeoffs via test measurements.
  • High Boost Shelf Hgl Practical maximum performance and power handling capability of the speaker limit the maximum high frequency boost.
  • the H s parameter might be set to reduce perceived distortion from a program source instead of from the speaker.
  • the internal operational settings can be made to change by command. This feature could help cover up increasing distortion when other parts of the system, including program material, is pushed to operate above their maximum linear power capability.
  • the H s parameter is +/- dB. Its setting is best determined experimentally via test measurements.
  • W L parameter can be dynamically modulated to extend bass or reduce distortion.
  • Adjustments to the response of the low-pass filter include peak frequency (W L ) and amplitude
  • a resonant cutoff may be preferred to compensate for a second cutoff inflection, or it can be used to restrict reproduced bandwidth.
  • the first application can extend response and reduce group delay distortion. Bandwidth restriction might be needed to make a distorted program sound better.
  • a peaking resonator and tracking high-pass filter (H P ) operate in a similar manner to the low- frequency peaking system.
  • the high-pass filter can be aligned to create a weighted response limiting and to provide a peaked cutoff response preferred in contemporary design practice.
  • High-pass filter adjustments include peak frequency (W H ) in Hz and amplitude (
  • Motor (B ) - Properties of the magnet structure and voice coil are consolidated to a traditional representation. Voice coil diameter, winding length, gap flux, pole dimensions, etc., are parts of traditional speaker models creating motor and generator equivalents. Force and back EMF relationship, with electrical current and mechanical motion, as well as other factors related to mechanical properties, get simplified representation. Sometimes leakage inductance and mechanical mass relationships are included. These elements are measured, calculated, or derived by various means to create a group of motor-related parameters that can affect many performance aspects of the speaker. Adjustable parameters to the compensation system and its processing are dependent on B .
  • the model can have relationships set up so that B L changes can modulate parameter settings.
  • the B specification can be used to track or readjust other parameters for similar speakers having different magnet weights, voice coil lengths, or other electro-mechanical factors.
  • the adjustable B L parameters can be: flux x length, volts x velocity, peak excursion length, and resistance/inductance or time constant.
  • Bass Resonance (W Q ) or Self-Resonance - This is the natural bass resonant frequency of the loudspeaker. Its value is determined by air volume, mechanical compliance, radiating area, damping, moving mass, motor characteristics, and other design features of the speaker.
  • an acoustic coupling factor is not part of the W 0 response, since it has already been accounted for in the L x parameter of the compensation system. This arrangement prevents interaction between adjustment parameters and the equivalence to mechanical behavior transforms to an LCR resonator equivalent of mechanical behavior.
  • User command language of frequency W 0
  • parameter coefficients are chosen from the switch or status inputs.
  • the compensation system can operate with fuzzy logic controls or other means to prevent unnecessary toggling or changes to parameter values. For example, different volume control settings, program levels, or bass content can change parameter coefficients and alignment to achieve a higher power or flatter response optimization.
  • the switching operation is likely to be audible, but the control hysteresis provides strategic changes that are less apparent or objectionable. Inexpensive equipment is intended and likely to overload or be pushed beyond a reasonable linear operation.
  • the compensation system operating with appropriate control logic can activate soft and loud operational states, each having optimum alignments, without creating a continuum of distortions inbetween.
  • Wave Interference Td The finite dimensions of speaker enclosures can create wave-related interference pressure behind the radiating surface. Usually this problem is ignored because of the complexity of the correcting response.
  • Expensive speakers are built with big motor assemblies having tight magnetic coupling to combat back-wave interference. Often these systems have inner baffles, layerings of different types of absorbent material, specially shaped rear cavities, or transmission line tubes to help remove the interference. Typical speakers exhibit constructive/destructive wave interference from their simple box type enclosures, which ultimately cause response ripples of increasing occurrence with frequency. The irregularity worsens as the shorted-turn effect, and damping from B L , are reduced by smaller magnets, reduced steel and other economic factors.
  • Corrections are made by a conjugate opposing response from a delay-and-feedback-loop process. Although an analog implementation is possible, DSP methods are more economical and by their nature make good equivalence to the physical behavior and problem to be fixed. A similar correction can reduce reflected interference from the floor, table top, walls, etc.
  • Tilt (dB) Most contemporary listeners prefer a speaker whose response drops slightly with increasing frequency. When a speaker is made less expensive its response tends to rise.
  • the compensation system corrects many problems and changes that occur from reducing magnet weight, improving efficiency and extending high frequency response.
  • the flat acoustic balance created from these conjugate corrections may sound either muddy or thin compared to a contemporary tone standard.
  • Tilt creates a compensating response slope.
  • the tilt parameter operates like a tone control and is used to achieve a desired bass-treble balance. Internal manipulation of the L x and H x , as well as traditional response leveling methods or processes create this response.
  • Adjustments can reduce group delay distortion, improve phase match to a sub woofer and align transient response. Adjustments can be made using physical or electrical measurements.
  • FIGS. 8a through 8f show control panel displays and menus used to adjust parameters. Measurement data, design expressions, and response curves provide useful information to adjust or tune the system to the loudspeaker.
  • the system generates conjugate responses to those of the speaker and silently removes delayed or long-settling mechanical sound.
  • Experience has shown better performance for many listening positions compared to more complex conventional leveling practice.
  • Common digital processes can be utilized for the implementation of these functions. Exemplary known digital processes are shown in Appendix A. Alternative known digital implementations can be used to achieve a wholly similar result.
  • the compensation system may also be implemented using analog circuits.
  • Cutoff Filters - Sallen and Key circuits can make active high-pass and low-pass filters with adjustable peaking responses.
  • Figure 9 shows the two filters configured to a single op amp. Mid-band response is flat and cutoff slopes are + and - 18dB per octave. Peaking amplitude of L P and H P are adjustable and correspond to FIG. 4b.
  • Constant Slope Equalizers - RC time constants are changed in an active feedback circuit to create response curves like FIG. 4a.
  • the circuit shown in FIG. 10 is the boosting half of a sophisticated parametric tone control. Its adjustment range is limited for good parametric independence between shelf and crossover.
  • Parametric Notches - Figures 11 and 12 show simple analog notch circuits having a wide tuning range. Notch depth stays constant but Q increases with frequency setting. Component values can be chosen to provide a reasonable approximation to Q 0 , Q ⁇ _ through Q n for practical adjustment ranges.
  • a composite filter element is made up from one or more sha ⁇ notches, each having energy added to either or both sides of the reject frequency.
  • the filter system can remove unwanted energy with little compromise or alteration to sonic balance.
  • Reject notches for this purpose are sharp, have high attenuation and are generally high-Q.
  • the side band compensations or restorations are best made from boost responses at both sides of the rejection. However, a one-sided compensation may work better for speakers having combined response roll off and interference energy problems.
  • the unsymmetrical boost helps flatten the frequency response. Other aspects are the same. Compensations can be very small, have low Q, and the average pink noise energy in a one-half to one octave band centered to the correction is constant when the process is on or off.
  • Decay from sounds can perceptually shift to low-Q side-band frequencies. Consequently, a double-tuned alignment for better immediate transient response settling is preferable to a one-sided or single-tuned boost method.
  • the resulting composite filter can be carefully tuned and scaled so that it can be silently tuned over a useful frequency range. Without weighting, the small response losses on either side of the correction contribute to a nasal sound. The coloration may be subtle but when more corrections are used the losses can overcome any advantages. This is particularly true if the response is just made flat, as it might with standard-practice equalization. Weighting eliminates the compromise and allows multiple corrections to be more effective and free of sonic interaction and also eliminates loss when unintentional correction is applied to a speaker having different behavioral properties.
  • neutral weighted response notches can be made up from resonant and anti-resonant responses added to the signal.
  • a correction element might incorporate a single high-Q notch, whose frequency is centered on the behavior mode.
  • One low-Q boost response is placed at the same frequency to provide the compensating equal-weight energy.
  • the circuit portion of FIG. 13 shows a practical combination of an active circuit notch and passive LRC boost resonator in a feedback path. Both parts create the weighted response notch.
  • the tuning range is limited, and the low-Q boost is likely to be audible, since the human hearing perception can resolve transient sounds decaying to a low-Q resonance.
  • FIG. 14 shows an example made from four tunable bi-quad resonators or state variable filters. Two of the filters create close spaced high-Q notches and the other two provide the boosted low-Q energy at the outer high and low sides. These state variable filters are easily created with DSP processors, and they maintain constant Q and notch depth over a wide tuning range.
  • the analog system creating the responses shown in FIG. 15 has eight precision variable resistors ganged on a single shaft to tune the W CC1 or weighted notch parameter.
  • FIG. 13 shows a circuit for one of four sections.
  • Figure 15 shows response curves for two different Q settings and these correlate to those in FIG. 4d.
  • the double-tuned boosts can be aligned to yield a faster and smaller settling response to transients.
  • a double- tuned notch like that from the figures offers similar advantages and also provides a dead- band or band-reject capability to accommodate manufacturing tolerances from one speaker to another. Side frequency boost is still needed and double-tuned resonators are best used.
  • Two or more rejection notches can share Q and amplitude settings as well as compensation boost. Combinations include two notches with three boosts, two notches with two asymmetrical boosts, three with two, etc.
  • a single low-Q boost with a frequency halfway between two notches can be used.
  • Three low-Q boosts with frequencies below, above, and between are a better variation.
  • the notch depth is often great and the side frequency boost is usually small.
  • the overall energy response to random noise averaged about the compensation region is made to be the same or slightly higher than without correction.
  • a hybrid analog-digital CCD device can create a small, convenient tunable delay. Though performance may be poor, they can be connected or configured like the example in FIG. 16 to provide interference-like behavior.
  • the circuit can create approximate conjugate responses to wavelength related reflection and transmission behavior from walls, tables and the insides of speaker enclosures or other parts of the transmission path or system.
  • the circuit can be set to create an inverted comb filter or additive interference like response which would be opposite in time, phase and amplitude to subtractive interference loss from reflecting surfaces.
  • the circuit can also be adjusted to have a comb filter like response to cancel additive energy from reflections within the speaker enclosure. Better time delay interference filters or comb filter like responses can be made from DSP processes. Both the analog and the DSP can be configured to be relevant to the physical reflection model and like other parts of the correction system, are controlled by parametric adjustments related to physical behavior.
  • the delay interference path filter has controls relating to dimensions, surface absorption, and the amount of interference correction needed.
  • Td relates to the difference between the direct path from the speaker to listener and the longer bounce path also from speaker to listener. Td also relates to the out and return path between the speaker and an opposite surface inside an enclosure. A wall behind the speaker can be characterized the same way. Larger Td gives a larger distance. RC relates to surface roughness or absorption at high frequencies. Larger RC product for greater loss or faster attenuation of upper frequency comb filter response and correction. The control Rl adjusts the magnitude of the response or correction. CW direction increases subtractive responses while the CCW position near the + input to the op amp gives maximum additive responses.
  • the circuit produces an interference response whose amplitude decreases with frequency. This matches or simulates losses of absorption materials of practical speakers. Much of the irregular response from small speakers can be experimentally changed to something that appears to be more easily processed by the compensation system. Usually, the delay setting to do this matches the back arrival wave relationship expected from the speaker enclosure. When it does, this one adjustable parameter equals a multitude of conventional response-leveling processes.
  • Figure 17 is an all pass or phase shift network. Its frequency response is flat however its output is in phase and high frequencies and out of phase at low frequencies.
  • the circuit alters transient response without changing frequency response.
  • the variable control increases the transition frequency as it is turned CW. This element is useful to correct group delay and other transient related responses.
  • weighted compensated notch filter of the present invention solves this problem and yields some other advantages as well.
  • two drivers woofer and tweeter
  • one or both drivers can have interference compensation without perceptual loss to the other.
  • One position having a bad response can be compensated without compromising the sound for other listening positions. The correction is hidden by the weighted side energy.
  • Some of the most important behaviors of loudspeakers cannot be modeled or implemented from traditional methods. Such behaviors include interference and resonant coupling, as well as nonlinear consequences from such behaviors.
  • other spatial factors related to stiffness of moving parts and high frequency de-coupling for motions away from a driving voice coil need to be considered. Any of these can create source movements, delayed energy release and phase error to binaural hearing. Often, such destructive responses can be invisible or very difficult to interpret from traditional microphone-and- spectrum-analyzer calibration methods.
  • An example of a parametrically addressed compensation for a specific physical effect is compensation for mechanical de-coupling in large full-range speakers.
  • Such speakers are usually designed to have the entire cone move at low frequencies. At high frequencies, only the inner part of the driver is the primary active radiator. The rest of the cone is intentionally de-coupled to attenuate its nodal breakup. This design choice changes the position of an equivalent radiation source.
  • a linear correction to move high- frequency radiation forward in time uses complex pass filters to create band-limited delay of the lower frequencies. Then, as frequency increases, a latent delay decreases thereby maintaining a phase match to the response order of the speaker. Some group delay distortions can be removed this way.
  • a physical dimension from the speaker along with attenuation and speed-of-sound properties of the cone can yield information to specify a correction from a dedicated filter process.
  • the delay effect and de- coupling frequencies can be experimentally determined to yield parameter values. If some of the speaker parts change size or attenuation properties, new values can be extrapolated.
  • weighted compensation can be parametrically moved to where it is needed. If needed, its severity can be modulated to best match program dynamics, distortion from the loudspeaker, and human critical-band hearing perception. Additional bass output capability and response extension can be had when the dynamics of the audio signal are detected and used to change parameters or hidden compensations. This technique can work for any speaker system operating from the improved method.
  • an adjustment list or bit map intended for the specialized system can have the same parameters and adjustments as the general-purpose system, i. e. , the controls have features in common.
  • an electronic system with a compensation system is capable of receiving instructions to compensate and optimize a variety of speaker models and products which can be attached to it, both generic speakers and those designed specifically for use with the compensation system. When needed, the system can improve clarity, imaging, and bass extension without changing sonic balance, i. e., the sonic signature of a product line is maintained.
  • Settling and nodal compensation parameter adjustments include frequency in Hz, Q as a number, and rejection in dB. Since multiple-order nodal behaviors are possible, the Q and rejection adjustments are more likely to have similar values for more than one compensation frequency. Controls can be linked so that two or more frequencies in Hz can specify corrections for nodal behaviors sharing a mechanical or interference property in common.
  • Bell-mode compensation for speaker cones provides a good example.
  • Several methods can determine these frequencies. Multiple nodes or wave-related interference can be observed using sine wave excitation and optical interferometry. Waterfall plots from MLSSA-type stimulus, as shown in FIG. 7, or a differential microphone probe can be interpreted to reveal settling energy from breakup. These behaviors are audible and the hidden compensation process can be manually or slowly swept in frequency to reveal sonic changes during pink-noise reproduction.
  • the experimental method requires caution and experience since room reverberation can imitate the mechanical sounds. Correlation between the three techniques is good, and when several frequencies from similar causes are determined, composite weighted notches of similar Q and shared boost parameters simplify the correction.
  • controls adjusting the compensation system are related to physical parts and acoustic properties of the speaker.
  • Other speakers of similar, but not exact design or construction can be improved in the same manner.
  • the control or specification information to do so has the same simple, intuitive language.
  • a small inexpensive speaker could be substantially improved with 16 parameter adjustments and a few default settings.
  • a conventional multi-band or graphic equalizer would need well over 100 band, and much more control information.
  • the compensation system uses slopes, crossovers, and other mathematical functions to create predicted corrections for characteristics of the speaker. These operations are controlled by coefficients or points, and by process commands instead of from documenting and calculating responses to linear plots. Since each process has a specialized nature, the range of frequencies, amplitudes, Qs, etc., confine parameter ranges to small portions of a control space.
  • a three-word code can create an accurately placed resonator or complex weighted response notch subsystem. In the case of 8-bit code words, this map or information sequence gives 128 points for a logarithmic frequency decade, +/- 20dB in l/2dB steps for amplitude, and 16 Q settings, as well as space for process commands and control formatting.
  • 384 points or frequencies in the audio band would be available for setting sha ⁇ rejection notches and weighted compensations. Bitmaps for other parametric controls and process commands may require less resolution, thus providing even greater economy.
  • This compact specification feature could be used for bar-code installation of the compensation system to correct a specific speaker design or for dynamic control of processes from codes hidden in data streams such as used in HDCD systems.
  • portable devices, such as hearing aids and communication systems benefit when the scope of processed information is reduced.
  • 384 points or frequencies in the audio band might be chosen for a successful process inco ⁇ orating ten basic operations, i. e., shelves, notches, compensations, cutoff filters, delays, etc.
  • the compensation system has 8 notches, one weighted notch for node correction, and a low frequency boost crossover and shelf. The high frequency drop provides a crossover to a tweeter.
  • the compensation system creates this conjugate curve from 24 adjustments (L x , L s , L P , W 0 , Q 0 ,
  • a strategy similar to compensating the removal of in-band signals can be used for the highest and lowest frequencies. For example, distortion caused by excess cone motion from bass energy can be less objectionable by reducing the input to the speaker. One way to do this is to restrict the low frequency response to a practical value. Quite likely, the speaker would have been able to make feeble bass reproduction below the cutoff, provided the program material does not mask the low bass signals. Wide dynamic range program material can force the speaker to produce perceivable output at these frequencies. Unfortunately, the resulting feeble output is frequently covered up by other sounds in the same perceptual band of human hearing. Hence, most of the time an extended response from the speaker is useless and only adds distortion and consumes amplifier power.
  • the weighted response correction of the compensation system can be applied to the audible side of either a low or a high frequency broadband or cutoff rejection or filter. If done carefully, the perceptual response appears unaltered and can be made to sound extended as it was before filtering. Large systems intended to reproduce high- power, sub-audible or infrasonic energy require a different approach, although the same method applies.
  • the compensation system combines a loudspeaker model and conjugate process to create a zero-phase filter whose acoustic output has low group delay distortion.
  • the peaked response not only complies with the standard practice but is used in the alignment to help improve group delay and becomes part of a hidden compensation that allows the band limiting feature to be turned on or off.
  • the compensation system can be made to change its cutoff depth and compensating energy with minimum audibility.
  • This feature allows the compensation system to track or modulate from changes of volume control settings, power levels, or program conditions competing for perceptual bands. In this manner, the bandwidth restriction can force more power to the speaker before distortion sets in. Since audible energy is now rationed a smaller amplifier can produce the same playback volume. These factors have economic importance. Speakers can have parts designed so that the system can benefit from the compensation system. They would have shorter voice coils and lighter-weight cones to produce higher acoustic output from an amplifier. Efficiency is higher, but mechanical behavior is often compromised and the acoustic output from such a design tends to rise with frequency. Without correction the speaker sounds harsh and shrill and therefore must be compensated. However, once these changes are corrected by the compensation system, the speaker plays louder, can be smaller, and a lower-powered amplifier can be used.
  • the peaked or compensated response is moved in frequency with a carefully worked out strategy.
  • Process settings and the related acoustic peaking frequency at a band edge becomes dependant on bass content of the program material, power reserve of the amplifier, and motion capability of the speaker.
  • playback level is high, and low frequency energy is strong, the peaking response is moved up in frequency to maintain a reasonable cone motion and distortion performance.
  • Most entertainment systems have equalizers, tone controls, and other user- operated or initiated features. Acoustic visibility is needed. The compensation system works best in tandem with these and can improve their performance.
  • Communication System - Communication systems can be subject to unwanted narrow-band noise or tones at fixed or varying frequency. Quite often some time latency is available allowing a subsystem to identify and track such tones. When it is not practical or possible to create an out-of-phase signal to remove the disturbance the compensation system achieves an effective result. Frequently, it is possible to track the disturbance with the parametrically moveable weighted response notch. Unless an intelligence signal has the same frequency as the one being rejected, the correction will be effective yet not degrade or change the sound. Frequently, communication systems have transducers such as microphones, headphones, and speakers as part of the sound reproduction system. These elements could have undesirable responses that can be compensated individually, or collectively as a system. One or more processors can be placed anywhere in the signal chain.
  • control parameter information may be identified or accessed by hidden codes in the signal path.
  • Auxiliary channels, as well as other means, can be used to convey this information. Since the compensation system uses this information efficiently to create very complex responses, the correction process can be installed in many systems. Examples include computer speakers, telephone systems for hearing impaired, and mobile communications. For these systems, the processors can be external or not part of the end user appliance.
  • the compensation system can be programmed to a particular model of appliance and externally activated. Part, all, or none of the processor can reside with the appliance.
  • Hearing Aid Many hearing difficulties arise from damage to hair cells within the auditory nerve. Frequently people suffer tinitus or head ringing, and have difficult understanding conversations in crowded noisy rooms. Sometimes a closely spaced group of cells corresponding to a narrow frequency band has had mechanical damage causing an excessive nerve response to high intensity stimulus. This action often sounds discordant and painful. It may cause disruption to a hearing feedback path to and from the brain, so as to initiate premature protection functions, thereby aggravating the unpleasant sensation. Since the stimulus causing the mechanical motion is in a range of frequencies easily defined by medical test routines, the parametric weighted notch filter can be easily tuned to the same frequencies to block sound transmission that excites these cells.
  • a recording may use music signals to define operating frequencies and timing of encoded security notches. Clock dependency is reduced and number keys are used to prevent someone from finding these frequencies and altering their pu ⁇ ose.
  • key identified parts of the program initiate decoding parameters used for verification.
  • the recorded notch should be silent or hidden as best as possible and it is likely to jump from one frequency to another.
  • the parametrically controlled weighted compensation method is ideal for this application, and the combination of keyed frequency jumping and hiding provides for an effective security system.
  • CD Player A typical electronic system, operating in either the digital or analog domain (or both), might combine intentional user adjustments and the compensation system. Parts descriptions, mathematical models, measured data, and human preference information may be combined and inco ⁇ orated into its design. Once parameters are defined and their coefficient values are determined an organized group of numbers can program an electrical or mathematical system to perform specific correction response for different shapes and sizes of loudspeakers. The parameter list, and even the individual correction modules, can be downloaded to a digital signal processor in a CD player or other device. This operation can be done at any time, so that it provides a programmable upgrade. It can be activated by bar code, remote control, downloaded from a computer, or installed to dedicated player/speaker combinations. While several particular forms of the invention have been illustrated and described, it will be apparent that various modifications can be made without departing from the spirit and scope of the invention.
  • FIGS. Al, A2 and A3 show possible implementations for the low-pass filter (Lp) and the high-pass filter (H P ) cut-off filters. The order of these particular filters is kept small to support a low-MIPS implementation.
  • FIG. A4 shows a possible implementation for the high and low shelving equalizers. These equalizers are used for L s and H s .
  • FIG. A5 shows a parametric equalizer implementation usable for boost or cut applications. Combinations of such equalizers can be combined, as shown in FIGS. A6 and A7, to build the compensated notch effect.
  • Transfer Function (1 st column is numerator coefficients in transfer function and 2nd column is denominator coefficients In transfer function). So this filter is a 2nd order IIR.
  • sampling frequency Fs : 44 IOC
  • Transfer Function (1st column is numerator coefficients in transfer function and 2nd column is denominator coefficients in transfer function). So this filter is a 1st order IIR.
  • the filter output is computed as per the above signal flow below we calculate the overall transfer lunction of the above system by transforming the numerator of the all pass section as necessary
  • FIG. A4 (Sheet 2 of 2) Digital Notch Parametrfc EQ section based on an all-pass section
  • the filter output is computed as per the above signal flow.
  • FIG. A5 (Sheet 1 of 2) transforming the numeralorof the all-pass section as necessary.
  • D: A
  • FIG. A5 (Sheet 2 of 2) Digital Implementation of a Weighted Notch #1
  • H(x) 20-log(GKx)-G2Cx)-G3(x))
  • the resulling fillers is a 2nd order IIR filters where column 0 represents the numerator and column 1 represents the denominator
  • the resulling filters are two 2nd order IIR filters where column 0 represents the numerator and column 1 represents the denominator
  • Figure Bl is a block diagram of a compensation system used to compensate a small bookshelf speaker having a 5-inch bass driver and 3-inch tweeter.
  • the speaker is characterized as follows:
  • FIG. B2 shows circuits used to create L*. H x> L s , H s> Lj., and H P filters and parameters adjustments. A lower frequency cutoff peak was added to create response character of an 8 inch bookshelf system. For this circuit, Q and peaking amplitude are set by the components marked by square boxes.
  • FIGS. B3 and B4 show W 0 notch sections and representative tuning for the speaker. W 0 ... and
  • FIG. B5 shows a single low-Q boost. Adjustments for boost and frequency are provided by the op amp section.
  • FIG. B6 is an all-pass equalizer used for time correction. The all-pass equalizer combines outputs from the six active process circuits.
  • the speaker tuning application is written as a Windows OS 32-bit application using the object-oriented MFC application framework (please refer to the documentation of MFC that is included with Microsoft Visual C++ development environment).
  • the application has a dialog interface.
  • the main dialog class, CTabDialog is a subclass of the MFC CDialog class.
  • the CTabDialog class implements a "tabbed" dialog interface.
  • Each tab in the dialog is a subclass of the MFC CPropertyPage class.
  • Each tab represents different aspects of the speaker correction algorithm. The following is a list of tab classes:
  • CMainPage which implements UI for pre and post volume controls amongst other things
  • CCutoffPage which implements UI controls for low and high peaking cutoff filters
  • CNotchPagel and CNotchPage2 which implements UI controls for a number of notch filters (to for example limit resonance in the speaker)
  • CStWaveRejectPage which implements UI controls for a set of filters which can limit standing waves in the speaker cabinet
  • CDBNotch which implements UI controls for a double-tuned notch filter
  • CAllpassPage which implements UI for a 2" -order allpass filter
  • Each adjustable parameter on a tab page is represented by an instance of the CSlider class.
  • Each UI slider has a range of 4096 discrete values.
  • the appropriate calculation takes place to transform the linear input value into one or more values necessary to compute the transfer function represented by the user settings.
  • These computed values are transmitted to the DSP using an I2C serial connection.
  • the DSP executes the calculations necessary for the real-time implementation of the above-mentioned transfer function.
  • the DSP is capable of computing a series of filter calculations in real-time to allow the total cascaded transfer function of all the speaker correction filters to be realized.
  • the DSP can receive analog or digital input data and transmit processed analog or digital output data.
  • the tab dialog object instance receives messages (from the Windows OS) in response to user action in the application menus
  • TabDialog receive mapped messages (from the Windows OS) in response (o user actions
  • CCOMPortChooser CCOMPortChooser (CWnd* pParent /* -NT LL*/) CDialog (CCOMPortChooser IDD, pParent)
  • CDialog :OnInitDialog () ;
  • CCutoffPage : CCutoffPage () : CPropertyPage (CCutoffPage: • IDD)
  • DDX_Control (pDX, IDC_CHECKS, m_Bypa ⁇ sFirstButton) .
  • DDX_Control (pDX, IDC_SLIDER6, m_HiBoostSlider)
  • DDX_Control (pDX, IDC_SLIDER5, inHiQSlider)
  • DDX_Control (pDX, IDC_SLIDER4, m_HiFreqSlider)
  • DDX_Control (pDX, IDC_SLIDER3, m_LoBoostSlider)
  • DDX_Control (pDX, IDC_S IDER2, m_LoQSlider)
  • DDX_Control (pDX, IDC_SLIDER1, m_LoFreqSlider) ; // ) )AFX_DATA_MAP
  • BEGIN_MESSAGE_MAP (CCuto fPage, CPropertyPage) // ⁇ ⁇ AFX_MSG_MAP (CCuto fPage) ON_WM_VSCROLL ( )
  • CAllpassPage property page IMPLEMENT_DYNCREATE CAllpassPage, CPropertyPage
  • CAllpassPage : CAllpassPage 0 : CPropertyPage (CAllpassPage :: IDD)
  • CAllpassPage : -CAllpassPage
  • DSPComm *m_Comm public void GetPureStrmgValue (int which, CStrmg &str) , void GetF ⁇ lterBlob (CStr ⁇ ngArray tarray) , virtual BOOL GetBypassSect ⁇ on ( ⁇ nt which) , virtual void SetBypassSect ⁇ on (BOOL value , int which) , virtual BOOL IsBusy O , virtual void GetStnngValue l int which, CString &str) , virtual BOOL IsReady (void) , virtual void SetAnaloglnput (long) , virtual int GetHDCDMode (void) , virtual void ResetAll (void) , virtual void SetHDCDGamScale ( long) , virtual void SetHDCDBypass (long) , virtual void SetDDXCo pBypass ( long) , virtual void SetBypass ( long value) ,
  • CDSP56kManager HWND p
  • virtual -CDSP56kJ anager 0
  • private void SetNotchQdong value long which, long freqwhich)
  • void SetNotchFreq long value, long which
  • void SetShelvFreq long value, long which
  • void SetBoostCut long value long which) void SetRawValue ( long value long which), double DoConvertFreqRange (double in double top double bottom), double ConvertFreqRange (int which) double ConvertQRange (long val)
  • double ConvertBoostCutRange long val
  • virtual void SendDSPValue long which) mt Check ⁇ umSREC (char *lmeptr int N) void GetSRecordAddressRangefchar * ⁇ long 'start long *end char **data) protected virtual void SetDelay ( long value) void SetLoCutof f (void) 64 void SetHiCutoff (
  • virtual void SetShelv2Boost (long value), virtual void SetNotchlCu (long value), virtual void SetNotchlQ(long value) , virtual void SetNotchlFreq(long value), virtual void SetNotch2Cu (long value), virtual void SetNotch2Q(long value) , virtual void SetNotch2Freq(long value), virtual void SetNotch3Cu (long value), virtual void SetNotch3Q(long value) , virtual void ⁇ etNotch3Freq(long value) , virtual void SetNotch4Cut (long value) virtual void SetNotch4Q(long value) , virtual void ⁇ etNotch4Freq(long value) , virtual void SetNotch5Q(long value) , virtual void SetNotchSBoo ⁇ t (long value), virtual void SetNotch ⁇ Cu (long value), virtual void SetNotch ⁇ Q(long value), virtual void SetNotch ⁇ Freqdong value) ,
  • CDSP56kManager GetSRecordAddressRange (char * ⁇ , long 'start, long *end, char **data) ⁇ long address, coun , sof se ;
  • CDSPSGkManager CDSP56kMana9er HVTND p
  • HVTND p CDSP56kMana9er
  • ra_Raw2DSPVals IkNotchSFreq) kDSPNOtch6Freq
  • ra_Raw2DSPVal ⁇ (kNotch ⁇ Q) kDSPNotch6Q
  • m_Raw2DSPVals (kNotchSCut) kDSPNotchGCut
  • kNotch7Freq] kDSPNOtch7Freq
  • m_Raw2DSPVal ⁇ (kNotc 7Q) DSPNotch7Q
  • m_Raw2DSPVals[kNotch7Cut] kDSPNotch7Cut
  • CDSP56kManager SetShelv2Boost (long value) ⁇
  • double CDSP56kManager ConvertFreqRange (int which) ⁇ double fval ; switch ( which )
  • CDSP5GkManager SetRawValue (long value , long which)
  • ⁇ string array GetAtd
  • sptr string
  • sscanf ⁇ ptr, "%d” , &f ⁇ leversion
  • ⁇ string array GetAt( ⁇ )
  • ⁇ ptr string
  • // skip comments sscanf (sptr, "%d ⁇ t0x%x", s.index, &value) , ⁇ f( index > kUIArraySize ) continue,
  • ⁇ m_DSPVals [kDSPBypassMask] m_RawVal ⁇ [kBypassMask] ; SendDSPValue (kDSPBypassMask) ,-
  • CDSP56kManager : GetFilterBlob (CStringArray & array)
  • GetPureStringValue (kNotch7Cut, cstr) ; array.
  • SetAtGro (j++, cstr) ;
  • GetPureStringValue (kNotch ⁇ Cut, c ⁇ tr) ; array.
  • SetAtGro (j++, c ⁇ tr);
  • GetPureStringValue (kNotchACut, cstr) , array.
  • SetAtGro (j++, cstr);
  • CDSP56kManager SetHiCutoff2Q(long value)
  • CDSP56kManager :GetPureStringValue (int which, CString tstr)
  • CDSP56kManager GetStringValue (int which, CString ⁇ str) ⁇ double value; char s [100] ,- switch! which )
  • m_DSPVals [kDSPBypassMask] m_RawVals [kBypa ⁇ sMask] , SendDSPValue (kDSPBypassMask) ,
  • CDBNotch dialog class CDBNotch public CPropertyPage
  • IDD IDD_PP11 ⁇ ; CButton m_Bypass; CSliderCtrl m_CompGainSlider,- CSliderCtrl m_CompQSlider; CSliderCtrl m_QSlider; CSliderCtrl m_FreqSlider; // ⁇ AFX_DATA
  • CDBNotch CDBNotch () CPropertyPage (CDBNotch IDD)
  • CDBNotch mes ⁇ age handlers void CDBNotch OnVScroll (UINT nSBCode, UINT nPos, CScrollBar* pScrollBar )
  • BOOL CDBNotch OnlnitDialog () ⁇
  • m_ParentWindow (CTabDialog *) GetParent () - GetParent () ; return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE ⁇ void CDBNotch: : SendStringToUI (int which) ⁇
  • CMainPage :CMainPage ( ) : CPropertyPage (CMainPage : : IDD) ⁇
  • CMainPage : : -CMainPage ( )
  • CPropertyPage DoDataExchange (pDX) ,- // ⁇ (AFX_DATA_MAP (CMainPage) DDX_Control (pDX, IDC_SLIDER8, m_Delay) ;
  • DDX_Control (pDX, IDC_SLIDER7, m_AnalogVol ) ; DDX_Control (pDX, IDC_BUTTONl , m_Re ⁇ etAll) ; DDX_Control (pDX, IDC_SLIDER3, m_PreVolumeSlider) DDX_Control (pDX, IDC_SLIDER1 , m_VolumeSlider) ; DDX_Check(pDX, IDC_CHECK1 , m_Bypa ⁇ sCheckBox) ; DDX_Check(pDX, IDC_CHECK2 , m_HDCDBypass) ;
  • DDX_Check (pDX, IDC_CHECK3 , m_GainScaleBypass) ; DDX_Check (pDX, IDC_CHECK4 , m_AnalogInput) ; / / ⁇ ⁇ AFX_DATA_MAP

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Acoustics & Sound (AREA)
  • Signal Processing (AREA)
  • Circuit For Audible Band Transducer (AREA)
  • Obtaining Desirable Characteristics In Audible-Bandwidth Transducers (AREA)

Abstract

A sound compensation system alters an electrical audio signal for input to a sonic reproduction device having associated behavioral characteristics. The behavioral characteristics of the device are defined by individual or groups of individual components of the sonic reproduction device and include mechanical, acoustic and electromagnetic behaviors. The model includes a plurality of filters that simulate at least one of the behavioral characteristics of the sonic reproduction device. The filters are defined by digital signal processes or by analog circuits and are characterized by one or more of an associated frequency, time, phase and transient response. These responses combine to define an overall response for the model. The filters include adjustable parameters which are used to alter filter responses to produce responses that are conjugates to the responses of the unaltered filters and thus the sonic reproduction device. A controller modifies the parameters.

Description

COMPENSATION SYSTEM AND METHOD FOR SOUND REPRODUCTION
BACKGROUND OF THE INVENTION Field of the Invention:
This invention relates generally to a compensation method and system for use in sonic transmission and reproduction systems and more particularly to a compensation method and system that uses parametric values to control or adjust processes having transforms or models with properties or responses like the components or elements used in the transmission or reproduction system.
Description of Related Art:
Most audio reproduction systems use electromechanical loudspeakers to acoustically reproduce audio signals. The electrical, mechanical, and acoustical properties of the loudspeakers are often less than ideal, causing distortions, response anomalies, and other coloration of the sound. Many techniques are used to compensate for the loudspeaker's characteristics in order to improve perceived audio quality.
Functional or behavioral models of loudspeakers are used in practice and found in literature to develop such compensations. A good example of models and how the modeling process works is described in "Active Equalization of Loudspeakers", Speaker Builder, February 1997. Models consolidate technical languages and are usually intended to imitate or simulate the acoustic responses of the speaker system from electrical stimulus. Model creation or synthesis frequently begins by making functional groupings of elements which collectively represent or behave like all or part of the speaker. Coil and magnet parts become motors, which are represented by resistors, inductors, capacitors, back EMF generators and other transformed parts. A combination of factors such as air volume, moving mass, acoustic loading, magnetic-braking, and mechanical losses might be analyzed and simplified to LCR resonator networks or circuits. Most often, the transformed electromechanical, acoustic, and mechanical representations expressed in the model are further simplified or reduced to fewer elements. The model still responds like the speaker, but the parts making the model no longer have exact behavioral equivalence to the parts making the speaker. Consequently, traditional models are neither intended, nor capable of making parametrically addressed zero-phase compensations when speaker parts are changed. One could characterize and invert the frequency response, as well as other properties, of a well-conceived model and achieve linear-phase correction of the loudspeaker. The technique does work to a fashion, but its dedicated, inflexible circuitry or specialized process tied to the traditional model limits its use to a one-speaker design. Some high-quality crossover networks constructed to divide the signal spectrum amongst multiple drivers may have some conjugate response correction like this.
A low-frequency resonant boost is intentionally designed for most speakers. Frequently, traditional models are made to represent quantifiable and predictable acoustic behavior as well as other speaker design factors affecting bass response. Mechanical construction and properties of air determine frequency, resonant losses and the configuration's effect on acoustic output from the speaker. A good approximation to a zero-phase conjugate or same-order correction for a wider frequency range can be designed and implemented in this manner. Several components are needed to match the resonant behavior, but all interact with each other when adjustments are made for a different speaker of similar concept and design. Therefore, the operation is not strictly parametrically controlled, as the adjustments must be re-calculated from the model to create the minimum-phase or exact match needed for best fidelity with the new speaker. When more corrections are added the interaction problem becomes formidable. The system must be tuned experimentally or the model analyzed each time an adjustment is made. Consequently, lumped model processes for response flattening are inherently designed for a specific speaker. The process must be redesigned for other speakers.
Traditional curve-fitting methods can require hundreds of data points and corresponding adjustments to set up and many components or much processing power to match the acquired frequency response. Analog methods are impractical and digital processes require much computation and extensive architectures to do this. Neither can provide phase accurate responses or the hidden corrections described later without having knowledge of the speaker and its operation. Without a model, the effort to combine amplitude, time and phase corrections together from measured responses becomes formidable. Some of the most important behaviors of loudspeakers (with respect to acoustically perceptible effect) cannot be modeled or implemented from traditional methods. Such behaviors include standing wave interference, modal breakup, and coupled resonance as well as nonlinear consequences from such potentially interacting acoustic and mechanical behaviors. Counterproductive random motion or breakup may occur. Even when the average response remains flat or is the same as other frequencies being reproduced, energy can build up during signal stimulus and be released when the signal changes or ceases. In addition, other spatial factors related to stiffness of moving parts and high frequency de-coupling for motions away from a driving voice coil need to be considered. Any of these can create source movements, delayed energy release, and phase error to binaural hearing. Often, such destructive responses can be invisible or very difficult to interpret from traditional microphone-and-spectrum-analyzer calibration methods.
For example, unwanted responses arising from nodal and standing wave behavior affect the settling time, directional behavior, and radiated output of a speaker. Frequently, these responses cause perceptual changes to intelligence signals yet may not be visible or recognizable from response plots. Mechanical motions having large stored energy can be out of phase at different parts of the transducer. The acoustic output might appear to be flat, but human binaural hearing can localize the behavior to its source and the altered perception can degrade stereo imaging.
Often, mechanical disturbances are audible yet invisible or hard to interpret from response measurements made using a frequency sweep and microphone. Parts of a radiating surface can vibrate with different phase relationships to other parts, so that their additive acoustic output is low compared to motions within the transducer and the energy storage involved. When signals at the node frequency change and suddenly stop the release of stored energy can interact with other signals at different frequencies. The resulting beat sounds between the two frequencies can be audible and very objectionable. Sounds with spectra in the interference frequency range may appear louder and granular. Human binaural hearing can localize the disturbance to the driver or surfaces from which directional lobes might bounce, thereby imparting further damage to the stage illusion from multi-speaker stereo reproduction. For this situation, frequencies creating the mechanical disturbance must be sufficiently attenuated to prevent unmasked reproduction of consequential responses. Experience has shown that a sharp, deep notch needed to do this removes enough energy around the correction frequencies to cause a nasal sound. If this inappropriate correction is modified to achieve flat response, then the mechanical sounds remain along with a potential undesirable balance aberration. Many small loudspeakers are constructed with a transducer, enclosure, and some resonant means to extend bass response such as a port or passive radiator. Usually, these parts are designed to achieve a practical and economical compromise between efficiency, frequency response accuracy, bass extension, and acceptable distortion. Designers of inexpensive, low-powered systems generally opt for higher efficiency to reduce amplifier requirements along with related costs of power supplies and packaging. The compromise situation exposes many undesirable behavioral aspects. Most traditional speaker correction methods apply some variation of amplitude equalization to flatten and extend response from speakers. Adjustments are sometimes done by ear. To be quantitative, one must acquire relevant data. The most common techniques to do this use spectral analysis from noise stimulus. Then, response plots or displays indicate how an equalizer is to be adjusted. More sophisticated techniques based on delayed acceptance or sampled windows can measure first-arrival responses from the speaker and remove higher-frequency room disturbance to create anechoic-like data. The intent is to capture information relevant either to a listener in a room or to standard measurement practice where a test microphone is usually specified and placed one meter from the speaker. Such technique creates a response that may sound balanced to the single-point test microphone. One or more known systems go slightly beyond this by adjusting path lengths, or time delays to align multiple speakers to a listening position.
Other techniques provide transient response waveforms, waterfall or successions of spectral plots after an event. Group delay and time-related information is acquired. Such data needs interpretation and has limited use for frequency response leveling practice. Some behavioral responses can be recognized but much more information must be known about the speaker. Measurement devices such as accelerometers, differential acoustic probes, as well as microphones, are needed for this. Instrumentation may be placed near a suspected behavior site and moved to explore how a response changes with position. Weighted notches can be tuned or slowly swept through suspected frequencies while subjectively observing noise production. More information is needed about dimensions of parts, listening positions, as well as floor, shelf, possibly a computer monitor, or other interceding objects that may be part of the listening environment. Other technical specifications or expressions are needed to complete the conjugate model capable of time-phase-accurate correction.
A human operator can assume an alignment role by adjusting a graphic equalizer, manually tuning a parametric filter, or changing settings to a crossover device. Commercial analog components perform these functions, but they have limitations. Graphic equalizers have up to 31 bands or resonators, parametric devices include several adjustable filters and a few have variable crossover and shelf functions. Many more filters are needed. Combinations of graphic and parametric equalizers are incapable of providing a large enough number of points, nor the exact phase and time response to effectively compensate complex behavior from a loudspeaker. Either the corrections do not match specific frequencies, thereby creating phase error, or the number of filters is inadequate to deal with settling time and standing wave issues. Group delay distortion, time-phase error, incomplete correction and other shortcomings are likely to outweigh other improvements.
DSP filters can create many more filter sections than is practical from analog circuits. Graphic equalizers made up with parametrically controlled sections have been used with specialized control-generating software to create room response leveling. Such processes are difficult to set up because the room interferes with the identification of important behavioral indicators. Without their input, conjugate response corrections are not possible. Standing wave and nodal distortion corrections could be made from such a system. However, the awkward compiling and processing needed to parametrically move the compensated notches would be difficult. Most likely, a single point response pickup and FFT has been used for data input to the system. Such methods cannot respond to or provide the time-phase information needed to create a true conjugate response to the speaker. Analysis systems, such as MLSSA, can remove room interference from measurements, and can produce frequency, transient, and settling response data from a loudspeaker system. However, the large amount of data from these measurements must be interpreted. The multiple-band graphic equalizer is not a good choice to install the correction.
DSP systems can economically create many parametric filters and time-related processes that are impractical with analog circuitry. Traditional large-scale DSP systems have little means to identify and cull out speaker behavior from other measurement anomalies. Their frequency-domain responses are likely to add phase errors and to overlook delayed settling energy. The sound might improve for one listening position but it will degrade for all others. More likely, the reproduced sound will change without definitive improvement. Hence, those concerned with the reproduction of sound have recognized the need for a system and method of modeling the complete behavior of sound reproduction devices such that conjugate responses to the sound reproduction device responses may be created. The need for a system and method employing modifiable conjugate response has also been recognized. Furthermore, the need has also been recognized for a system and method that compensates the reproduction of sound independent of the environment in which the sound is to be heard. The present invention fulfills these needs and others.
SUMMARY OF THE INVENTION Briefly, and in general terms, the present invention provides a system and method for modeling individual response characteristics of a sonic reproduction device to create a conjugate model for improving frequency, time, phase, and amplitude performance of the device and to provide improved sonic balance, sound clarity, reduced distortion and improved stereo imaging.
In a first aspect, the invention relates to an apparatus for modifying an electrical audio signal for input to a sonic reproduction device characterized by a plurality of individual responses. The individual responses of the device combine to define an overall response. Each individual response includes one or more of a frequency, time, phase or transient response. The apparatus includes a plurality of modification filters having modification responses that simulate the plurality of individual responses of the sonic reproduction device. The modification filters receive the electrical audio signal, modify the electrical audio signal and provide the electrical audio signal to the sonic reproduction device. The apparatus further includes a plurality of adjustable parameters. Each of the adjustable parameters is associated with at least one of the modification filters. The adjustable parameters allow for adjustments to the responses of the modification filters. The adjustments create a plurality of individual conjugate responses. Each individual conjugate response is associated with at least one of the plurality of individual responses.
By creating a plurality of filters or networks having responses that model the individual responses of the reproduction device and providing parameters for adjusting the filter or network responses, the system allows for the creation of conjugate responses that provide specific opposing or correction responses to the response of the reproduction device.
In a detailed aspect of the invention, the plurality of individual responses of the sonic reproduction device are related to at least one of mechanical, acoustic and electromagnetic behavior of the sonic reproduction device. In another detailed facet of the invention, the plurality of modification responses combine to form an overall response that is a conjugate to the overall response of the sonic reproduction device. I n yet another detailed aspect of the invention, at least one of the modification filters comprises a cut-off filter and the parameters for adjusting the frequency response of the cut-off filter include peak frequency, amplitude and Q parameters. In still another aspect of the invention, at least one of the modification filters comprises a constant slope equalizer and the parameters for adjusting the frequency response of the constant slope equalizer include crossover frequency and boost shelf parameters. In other detailed facets of the invention, at least one of the modification filters comprises a parametric notch filter and the parameters for adjusting the frequency response of the parametric notch filter include notch frequency, amplitude and Q parameters and at least one of the modification filters comprises a parametric notch-boost filter and the parameters for adjusting the frequency response of the parametric notch-boost filter include notch frequency, amplitude and Q parameters.
In a second aspect, the invention relates to a sound compensation system for altering an electrical audio signal for input to a sonic reproduction device having associated behavioral characteristics. The system includes a model of the sonic reproduction device. The model includes a plurality of filters or processes that simulate at least one of the behavioral characteristics of the sonic reproduction device. Each filter has an associated response that combine to define an overall response for the model. Each individual response includes one or more of a frequency, time, phase or transient response. The system also includes a controller that modifies the response of each of the plurality of filters to transform the filter into a conjugate filter. Each conjugate filter has a response that is a conjugate to the original response of the filter or process.
In a detailed aspect of the invention, the behavioral characteristics are defined by individual or groups of individual components of the sonic reproduction device. By modeling the reproduction device's individual components and the characteristics of those components or groups of components, individual compensations for these characteristics can be created and manipulated parametrically. Therefore, these same compensations can be applied to additional systems having similar components or characteristics.
In other detailed aspects of the invention, the filters are defined by digital signal processes or by analog circuits and the controller includes a computer or adjustable circuit components. In other detailed aspects of the invention, the sonic reproduction device comprises a speaker and at least one of the plurality of filters includes at least one associated adjustable parameter and the value of the parameter is calculated based on physical characteristics of the speaker, derived from a standard speaker model or determined experimentally using standard test measurements. In yet another detailed aspect of the invention, the controller is configured such that an adjustment in the setting of one parameter modulates the setting of at least one other parameter. In still another detailed facet of the invention, the controller monitors the program conditions at the sonic reproduction device and sets at least one of the parameter values based on the program conditions.
In a third facet, the invention relates to a sound system. The sound system includes a sonic reproduction device having associated mechanical, acoustic and electromagnetic behavioral characteristics. The sound system also includes a source for outputting an electrical audio signal to a model of the sonic reproduction device. The model includes a plurality of filters that simulate at least one of the mechanical, acoustic and electromagnetic behavioral characteristics of the sonic reproduction device. Each filter has an associated response that includes at least one of a frequency, time, phase or transient response. The model outputs the electrical audio signal to the sonic reproduction device. The sound system further includes a controller that modifies the responses of the filters to transform the model into a conjugate model having a plurality of filters with responses that comprise conjugates to the original response of the filter.
In a fourth aspect, the invention relates to a method for modifying an electrical audio signal for input to a sonic reproduction device that is characterized by a plurality of individual responses which in combination define an overall frequency response for the sonic reproduction device. Each individual response includes one or more of a frequency, time, phase or transient response. The method includes the steps of simulating the plurality of individual responses with a plurality of filters and adjusting the responses of the plurality of filters such that, for each filter, the adjusted response comprises a response that is a conjugate to one of the individual responses. The method further includes the step of inputting the electrical audio signal to the filters.
In a detailed aspect of the invention, at least one of the filters comprises a cut-off filter and the step of adjusting the frequency response of the cut-off filter includes the step of setting at least one of peak frequency, amplitude and Q. In another detailed facet of the invention, at least one of the filters comprises a constant slope equalizer and the step of adjusting the frequency response of the constant slope equalizer includes the step of setting at least one of crossover frequency and boost shelf. In still another detailed aspect, at least one of the filters comprises a parametric notch filter and the step of adjusting the frequency response of the parametric notch filter comprises the step of setting at least one of notch frequency, amplitude and Q. In yet another detailed aspect of the invention, at least one of the filters comprises a parametric notch-boost filter and the step of adjusting the frequency response of the parametric notch-boost filter comprises the step of setting at least one of notch frequency, amplitude and Q.
In a fifth facet, the invention relates to a method of altering an electrical audio signal for input to a sonic reproduction device having associated behavioral characteristics. The method includes the step of simulating at least one of the behavioral characteristics of the sonic reproduction device with a plurality of filters. Each of the filters has an associated response comprising at least one of a frequency, time, phase or transient response. The method further includes the step of, for each of the filters, modifying the response of the filter to transform the filter into a conjugate filter having a response that comprises a conjugate to the original response of the filter. In detailed facets of the invention, the sonic reproduction device comprises a speaker, at least one of the plurality of filters has at least one associated adjustable parameter and the step of modifying the response of the filter includes one or more of the following pairs of steps calculating the value of the adjustable parameter value based on the physical characteristics of the speaker and setting the parameter to the calculated value, deriving the adjustable parameter from a standard speaker model and setting the parameter to the denved value and determining the adjustable parameter expenmentally using standard test measurements, and setting the parameter to the determined value. In still another detailed facet of the invention, the method further includes the step of modulating the setting of at least one parameter in response to the setting of another parameter. In another detailed facet, the method further includes the steps of momtoπng at least one program condition at the sonic reproduction device and setting at least one of the parameter values based on the program condition.
These features and the ability to maintain sonic neutrality make a compensation system and method capable of complex, dynamically changing response corrections, which can be controlled and adjusted with simplified, intuitive control specifications. Compared to traditional response-leveling methods, the compensation method and system requires less processing complexity and can easily be applied to different sound- reproducing systems. The compensation method and system, as a whole or in piece parts, can be turned on or off, moved from one frequency to another, or otherwise be changed by simple, intuitive commands.
These and other aspects and advantages of the present invention will become apparent from the following more detailed descnption, when taken in conjunction with the accompanying drawings which illustrate, by way of example, the preferred embodiments of the invention.
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram of a sonic reproduction system incorporating a compensation system in accordance with the invention;
FIG. 2 is a block diagram of a compensation system having a plurality of modification filters, each having a plurality of adjustable parameters for modifying one or more of the frequency, time and phase responses of the filters,
FIGS. 3a-3b depict a plurality of response components for a loudspeaker; FIG. 3f depicts the overall response formed when combining the individual responses of FIG. 3a-3e; FIGS. 4a-4e depict a plurality of adjustable modification responses for a compensation system, each response is adjustable to form a conjugate response to the response components of FIGS. 3a-3e;
FIG. 4f depicts the overall conjugate response formed when combining the individual frequency responses of FIGs 4a-4e;
FIG. 5 is a graph depicting the motion for a circular cone to produce one acoustic watt output;
FIG. 6 depicts the frequency responses for two small loudspeaker drivers;
FIG. 7 depicts a waterfall plot wherein the arrows at the right show the increasing time axis;
FIGS. 8a-8f depicts a series of graphical user interfaces for adjusting parametric controls for modifying the responses of the modification filters;
FIG. 9 is a schematic of an low-pass/high-pass peaking filter, where all Cs must change to move frequency; FIG. 10 is a schematic of an active RC or constant slope equalizer that boosts and has approximate parametric independence, where Cc and Re are both very large to bias the op amp;
FIG. 11 is a schematic of a frequency movable notch;
FIG. 12 is a schematic of an alternate configuration of a frequency movable notch;
FIG. 13 includes a schematic diagram of a weighted notch filter and the responses for boost, and notch components and a combined response, obtainable using the filter,
FIG. 14 includes a schematic diagram of a multi-resonant weighted notch filter and the responses for boost and notch components and a combined response obtainable using the notch filter;
FIG. 15 depicts the frequency, and phase responses for a notch filter;
FIG. 16 is a schematic of a delayed interference simulator/compensator where CW equals the same response as interference, CCW equals a conjugate correction and RC equals a decrease compensation for higher frequencies; and
FIG. 17 is a schematic of an all-pass or phase shift network.
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS The following description focuses on the application of the present invention to a loudspeaker system. The invention, however, is not limited to such applications and may be applied to other sonic transmission and reproduction devices such as those set forth at the end of the specification.
Referring now to the drawings, wherein like reference numerals denote like or corresponding parts throughout the drawing figures, and particularly to FIG. 1 , there is shown a system 10 incorporating the present invention. The system 10 includes a signal source 12, for providing an electrical audio signal. The signal source may be, for example, a CD player. The output 14 from the signal source 12 is input to a compensation system 16 which employs detailed features and aspects of the present invention. The output 14 is processed by the compensation system 16 to produce a compensated electrical audio signal 18 which is fed to a power amplifier 19 and a loudspeaker 20.
With reference to FIG 2, the compensation system 18 employs a plurality of filters 24 which, either individually or in combination, exhibit individual compensation responses which simulate the frequency, time and phase responses exhibited by the various mechanical, acoustic and electromagnetic components of the loudspeaker. Associated with each of the filters 24, and thus each of the compensation responses, is one or more adjustable parameters 22. The filters 24 are created using DSP or analog circuits. Digital signal processing is the preferred implementation, since analytical models of loudspeaker behavior translate easily to the mathematical synthesis techniques used for designing digital systems. Analog circuits have distortion build-up in cascade architectures. Therefore, a practical analog implementation of the compensation system 18 is possible only when the analog designer is aware that parallel-connected circuit elements can be used when behavioral responses are isolated and non-interactive. Some parameter 22 adjustments interact with one or more parts of the compensation system. A digital implementation provides the ability to utilize a compilation of possible settings or to calculate these relationships as needed. When the compensation system is controlled from a computer the setup adjustments appear simple and intuitive.
Each of these computed and adjustable compensation responses can be scaled to a parametrically variable, feature, or design aspect, relating to size, a moving property, or acoustic radiation behavior, amongst other things. Time delays, maximum excursion limits, wavelength relationships, nodal and standing wave frequencies, boundary reflections and like properties of the speaker can be adjusted and used by the compensation system. Instead of compiling or reducing speaker elements to create a lumped response system, the compensation system uses minimum-phase equivalence and strings of non-interacting filters. A typical overall response for a small speaker is shown in FIG. 3f. The same response is repeated at the top of FIG. 4. Figures 3a-3e shows a plurality of individual responses related to speaker components which combine to produce the overall response curve. Figures 4a-4e show a plurality of individual compensation responses which are adjusted via a plurality of adjustable parameters, e. g. , Ls, Hs, Lx, Hx, etc., to produce a plurality of conjugate responses. Properties of the parameters are described in detail below. As shown in FIG. 4f, the individual conjugate responses combine to produce or an overall conjugate response . The combination of the overall speaker response (FIG. 3f) and conjugate response (FIG. 4f) produce a smooth response. From FIGS. 3a and 4a, the first and second cutoff inflections for both high and low frequencies are evident. These points on the curve determine the frequencies for Lx, Ls, Hx, and Hs. When voice coil length and motional compliance capability are known, then a calculation or chart, similar to the one shown in FIG. 5, can help determine a reasonable frequency and amplitude for LP. HP is treated in a similar manner. Related inflections, cutoff, and frequencies are shown in FIGS. 3b and 4b. Amplitude settings of LP and HP have subjective power handling and weighted compensation issues.
Self-resonance of the driver operating in its enclosure can be measured or calculated to yield W0. The related Q0 and |A|0 settings can be experimentally measured or calculated from traditional models, provided the acoustic coupling factor has been removed. Figures 3d and 4d show this bass compensation.
Representations of a mechanical resonance, like W, , are seldom used in conventional models. The higher frequency parts of FIGS. 3d and 4d show that acoustic response error and coloration from W, can be removed by setting |A|, . A surround resonance is noted and a preset or default Q can be chosen to compensate a resonant behavior model typical of loudspeaker materials involved.
Nodes and interference behaviors are evident in FIG. 3e. Other examples in FIG. 6 reveal node jumps, interference, and related problems frequently called "cone cry" because of harsh, smeared sound. Waterfall or MLSSA plots like those shown in FIG. 7, can show the frequency and delayed breakup consequences typical of such high- energy moving interference. Hidden compensation notches WCC1 and WCC2 of FIG. 4e remove these frequencies and energy storage problems.
A slope or tilt EQ is added to achieve a best listener preference. Figures 3c and 4c show behavior and correction. Additional downward tilt might be added for subjective balance. As can be seen, approximately 12 to 16 adjustments, each spanning as few as 8 bits of resolution, can make a very good conjugate correction. Representative frequency responses from two loudspeaker driver units are shown in FIG. 6. Note that, as indicated by the roll off of the response curve at the low end, the W0 and second inflection response related to LP are missing because the driver operates in a very large enclosure. Other than this, the other parametrically related features are evident and adjustments can be worked out from these curves.
The following parameters allow for the creation of, simulations of, or conjugates to, the complex frequency, phase, and time responses of a loudspeaker. These adjustable parameters 22 and their operations can approximate zero-phase response, extend bass output, and remove mechanical sounds from a speaker (other parameters can be used in a similar manner). The individual compensations can be performed digitally or using active or passive analog circuits, such as RC circuits, analog resonators, or fully parametric circuits like state- variable filters or biquads.
Figure imgf000014_0001
Figure imgf000015_0001
Somewhere between 8 and 32 parameter adjustments might be used to program the compensation system and operate an adequate compensation process. Since parameters are related to specialized physical and behavioral aspects, data requirements for adjustment ranges and precision are much smaller than needed for coverage of human perception. Eight-bit resolution is adequate for many of these, so that a one-time data stream of 1-5 kbits characterize a very complex response from the model. A description of the foregoing parameters follows.
Low Crossover (Lv or Acoustic Coupling - Low frequency output depends on the size of radiating surfaces. The 6dB-per-octave loss from this relationship is inherently compensated by increased cone motion provided the back voltage from the motor structure is small compared to the driving signal. If compliance were infinite and the motor produced force without velocity restriction, this idealized configuration would have flat response. Real systems having air volumes, mechanical stiffness, and velocity limits have two practical crossover points where the response breaks from flat and converges to 6dB/octave and then to 12dB/octave bass loss. Usually, the second inflection is near the lowest useful response of the loudspeaker and often becomes impractical to compensate. The control parameter for this compensation is frequency in Hz and the conjugate response (specific compensation) is a +6dB/octave boost for decreasing frequency. This boost starts at the first response inflection from the speaker. The value for this parameter can be measured by applying a test signal, e. g. , sine wave, to the speaker and measuring the response. The value may also be calculated based on physical characteristics of the speaker such as cone and coil mass. The value may also be derived from a speaker model such as a standard Theil/Small model which is generally provided by the speaker manufacturer.
High Crossover (Hx) or Mass-Compliance Factor - High frequency output depends on the size and velocity of the radiating surfaces. Usually, the wavelengths of interest for frequencies near cutoff are small compared to the motional part of the speaker creating the output. Stiffness and damping properties of the cone material affect this transition from whole surface radiation at lower frequencies. Higher frequencies radiate nearer the voice coil. Moving mass eventually creates a 6dB/octave reduction of motion with increasing frequency. Leakage inductance from the motor assembly adds further compliance to the system to create a second inflection making a 12dB/octave drop at the highest practical frequencies. These losses, combined with decreased radiating area, create a reduction of acoustic output. At lower frequencies, the two relationships can be skillfully balanced to create flat acoustic response. The control parameter for this compensation is frequency in Hz, and the conjugate response is a 6dB/octave boost with increasing frequency. The value for this parameter can be measured or calculated in a manner similar to that previously described for low crossover. Low Boost Shelf (Ls) - Maximum boost from Ls is restricted to practical maximum limits from the amplifier power, cone motion, voice coil length, enclosure size, and intended bass extension. These requirements conflict and interact, e. g., longer voice coils require bigger amplifiers and suspension parts. For example, an extended coil can provide greater linear excursion and bass output potential, but efficiency decreases unless flux energy from the magnet is increased. Increased excursion requires bigger surrounds and the cone diameter must be increased to maintain the same radiating area and bass output. Bass resonance is lower, but the speaker must be physically larger, and the increased moving mass further reduces efficiency. If amplifier power is limited the enclosure becomes larger. Manipulation of the Lx, W0 (described below) and Ls parameters makes efficient or extended response loudspeaker designs with much less compromise. In addition, the Ls parameter can be made to change or track different volume control settings and program dynamics, so that the speaker system can operate near its maximum capability for a wide range of conditions. The Ls parameter is affected by design and construction factors, which include radiation area, compliance, and force factor of the driving motor. The modeled parameter can track changes to these factors with very little interaction. The Ls parameter is +/- dB. The Ls parameter setting can be determined by experimenting with compromise tradeoffs via test measurements.
High Boost Shelf Hgl - Practical maximum performance and power handling capability of the speaker limit the maximum high frequency boost. In some applications the Hs parameter might be set to reduce perceived distortion from a program source instead of from the speaker. As with Ls, the internal operational settings can be made to change by command. This feature could help cover up increasing distortion when other parts of the system, including program material, is pushed to operate above their maximum linear power capability. The Hs parameter is +/- dB. Its setting is best determined experimentally via test measurements.
Low Peaking (WL - A resonant bass cutoff is often preferred. Recordings are balanced for this and most speakers are designed to have self-resonant bass enhancement. Generally, larger speakers have lower resonant frequencies and listeners associate value to this relationship. The WL parameter provides a low frequency resonant boost below the natural self-resonance (W0) of the speaker itself. When a low
QL compensating response dip removes the W0 effect, the speaker system behaves electrically and sonically as if it were larger. It will not have the boom or box sound of an equalized small speaker. To prevent excess distortion and power draw, the signals below WL are attenuated rapidly and the high-pass filter involved tracks the WL parameter setting. This action has subjective factors similar to weighted compensation, since frequencies below cut-off can be weak but still audible when not masked by other sounds in the WL critical band of human hearing. Generally, WL peaking is adjusted and set to control power and distortion for maximum playback conditions. For other conditions, the high-pass or sub-bass filter can be shut off and parts of the low-pass filter (LP) moved or changed without obvious subjective consequence. As mentioned, the
WL parameter can be dynamically modulated to extend bass or reduce distortion.
Adjustments to the response of the low-pass filter include peak frequency (WL) and amplitude |A | in dB. Default QL setting is implied. High Peaking (WH) - A resonant cutoff may be preferred to compensate for a second cutoff inflection, or it can be used to restrict reproduced bandwidth. The first application can extend response and reduce group delay distortion. Bandwidth restriction might be needed to make a distorted program sound better. A peaking resonator and tracking high-pass filter (HP) operate in a similar manner to the low- frequency peaking system. The high-pass filter can be aligned to create a weighted response limiting and to provide a peaked cutoff response preferred in contemporary design practice. High-pass filter adjustments include peak frequency (WH) in Hz and amplitude (|AH|) in dB. Default QH setting is implied. Motor (B ) - Properties of the magnet structure and voice coil are consolidated to a traditional representation. Voice coil diameter, winding length, gap flux, pole dimensions, etc., are parts of traditional speaker models creating motor and generator equivalents. Force and back EMF relationship, with electrical current and mechanical motion, as well as other factors related to mechanical properties, get simplified representation. Sometimes leakage inductance and mechanical mass relationships are included. These elements are measured, calculated, or derived by various means to create a group of motor-related parameters that can affect many performance aspects of the speaker. Adjustable parameters to the compensation system and its processing are dependent on B . Therefore, if needed, the model can have relationships set up so that BL changes can modulate parameter settings. For example, the B specification can be used to track or readjust other parameters for similar speakers having different magnet weights, voice coil lengths, or other electro-mechanical factors. The adjustable BL parameters can be: flux x length, volts x velocity, peak excursion length, and resistance/inductance or time constant. Bass Resonance (WQ) or Self-Resonance - This is the natural bass resonant frequency of the loudspeaker. Its value is determined by air volume, mechanical compliance, radiating area, damping, moving mass, motor characteristics, and other design features of the speaker. Unlike traditional bass models, an acoustic coupling factor is not part of the W0 response, since it has already been accounted for in the Lx parameter of the compensation system. This arrangement prevents interaction between adjustment parameters and the equivalence to mechanical behavior transforms to an LCR resonator equivalent of mechanical behavior. User command language of frequency W0,
Q0 and coupled energy or amplitude |A|0 can specify conjugate responses to the mechanical resonant behavior. Because the speaker behavior and correction responses for the system are of the same order, but opposite amplitude, the group delay performance can be very good. Adjustments are W0 in Hz, Q0 as a number, and |A|0 in dB. These adjustment values can be experimentally determined by very-close-range instrumentation, position sense transducers, or by calculation. Port Tuning (WB) - Many speakers are designed to provide a secondary bass resonance intended to extend frequency response or improve power handling. Physical structures to do this include ports, tubes, passive resonators, labyrinths, other woofers, etc. Much literature has been devoted to modeling and tuning these systems, usually to achieve flattest possible frequency response. Such models, combined with the compensation system, have the potential to extend bass, improve transient response, and improve efficiency without adding cost to the speaker. Greater power handling and extended bass capability can be structurally designed and the resulting frequency response irregularity and end band distortion compromise from using this strategy can be removed by conjugate correction. When this choice is made, ports can be larger and tuned lower, enclosures made smaller, along with other changes to improve bass. The resulting consequences of rough response and sub-bass overload are reversed by the compensation system. Flags or switches can be part of a control operation, which identifies program conditions or response states at the loudspeaker. Limit conditions from samples or tests determine switch states for this feed-forward/feed-back type system. Then, parameter coefficients are chosen from the switch or status inputs. In this manner, the compensation system can operate with fuzzy logic controls or other means to prevent unnecessary toggling or changes to parameter values. For example, different volume control settings, program levels, or bass content can change parameter coefficients and alignment to achieve a higher power or flatter response optimization. The switching operation is likely to be audible, but the control hysteresis provides strategic changes that are less apparent or objectionable. Inexpensive equipment is intended and likely to overload or be pushed beyond a reasonable linear operation. The compensation system operating with appropriate control logic can activate soft and loud operational states, each having optimum alignments, without creating a continuum of distortions inbetween.
Mechanical Resonance (Wt, W2. through Wn - Many parts and actions of a speaker system behave like resonators. Unlike W0, most of these are unintentional and they usually add to the acoustic output of the speaker. These include flexure and mass behavior of the domes, cones, and surrounds, as well as cabinet resonance, among others. Equivalent LCR behavior is parameterized to non-interacting individual corrections or adjustments similar to those for W0. Resonance adjustments are W1 ? W , through Wn in Hz, Q, , Q2, through Qn (described below) in units, and |A|ι , |A|2 through |A|n (described below) in +/- dB. Often a small, low-Q resonance that appears similar to room responses has sonic impact. Unlike a test microphone used for traditional response leveling, a listener can move around and, in time, can sense and become aware of signal decays that collapse to broadband resonance. Conjugate correction eliminates this difficulty and helps to improve the outcome from ancillary equalization systems.
Settling Resonance (WC 1, WCC2 through WCCn) - The hidden compensation processes using multi-resonator notches and weighted side energy enhancements are placed in frequency and adjusted by these control parameters. Sonic consequences from delayed nodal resonance and standing wave interference is diminished or removed.
Figure imgf000020_0001
Q parameters for some frequencies can be estimated default values which work for materials, designs, and construction materials common to speakers. Since it is almost impossible to casually determine Q from a response plot or simple measurement, the fixed value is practical, and the default choice simplifies and reduces the number of adjustments.
Wave Interference Td - The finite dimensions of speaker enclosures can create wave-related interference pressure behind the radiating surface. Usually this problem is ignored because of the complexity of the correcting response. Expensive speakers are built with big motor assemblies having tight magnetic coupling to combat back-wave interference. Often these systems have inner baffles, layerings of different types of absorbent material, specially shaped rear cavities, or transmission line tubes to help remove the interference. Typical speakers exhibit constructive/destructive wave interference from their simple box type enclosures, which ultimately cause response ripples of increasing occurrence with frequency. The irregularity worsens as the shorted-turn effect, and damping from BL, are reduced by smaller magnets, reduced steel and other economic factors. Corrections are made by a conjugate opposing response from a delay-and-feedback-loop process. Although an analog implementation is possible, DSP methods are more economical and by their nature make good equivalence to the physical behavior and problem to be fixed. A similar correction can reduce reflected interference from the floor, table top, walls, etc.
Tilt (dB) - Most contemporary listeners prefer a speaker whose response drops slightly with increasing frequency. When a speaker is made less expensive its response tends to rise. The compensation system corrects many problems and changes that occur from reducing magnet weight, improving efficiency and extending high frequency response. However, the flat acoustic balance created from these conjugate corrections may sound either muddy or thin compared to a contemporary tone standard. Tilt creates a compensating response slope. The tilt parameter operates like a tone control and is used to achieve a desired bass-treble balance. Internal manipulation of the Lx and Hx, as well as traditional response leveling methods or processes create this response.
Delay or All -Pass - This parameter moves the signal in time to compensate for transducers radiating high and low frequencies from different places. Adjustments can reduce group delay distortion, improve phase match to a sub woofer and align transient response. Adjustments can be made using physical or electrical measurements.
FIGS. 8a through 8f show control panel displays and menus used to adjust parameters. Measurement data, design expressions, and response curves provide useful information to adjust or tune the system to the loudspeaker. The system generates conjugate responses to those of the speaker and silently removes delayed or long-settling mechanical sound. Experience has shown better performance for many listening positions compared to more complex conventional leveling practice. Common digital processes can be utilized for the implementation of these functions. Exemplary known digital processes are shown in Appendix A. Alternative known digital implementations can be used to achieve a wholly similar result. The compensation system may also be implemented using analog circuits.
However, parts of multi-resonators or coupled functions are not likely to track wide adjustment ranges unless they are complex. Hence the analog circuits are shown for their functionality and similarity to well-known better DSP equivalents. These circuits have adjustable parametric controls, but they require component changes to simulate the parametric alignment accuracy inherent with the digital system. The following examples are traditional circuits that have semi -parametric adjustment capability and produce conjugate responses like those described.
Cutoff Filters - Sallen and Key circuits can make active high-pass and low-pass filters with adjustable peaking responses. Figure 9 shows the two filters configured to a single op amp. Mid-band response is flat and cutoff slopes are + and - 18dB per octave. Peaking amplitude of LP and HP are adjustable and correspond to FIG. 4b.
However, the frequencies must be preset for this circuit. For this example, the two sections do not interact with each other because of their wide frequency separation. Constant Slope Equalizers - RC time constants are changed in an active feedback circuit to create response curves like FIG. 4a. The circuit shown in FIG. 10 is the boosting half of a sophisticated parametric tone control. Its adjustment range is limited for good parametric independence between shelf and crossover. Parametric Notches - Figures 11 and 12 show simple analog notch circuits having a wide tuning range. Notch depth stays constant but Q increases with frequency setting. Component values can be chosen to provide a reasonable approximation to Q0, Qι_ through Qn for practical adjustment ranges.
Weighted Compensating Notches - A composite filter element is made up from one or more shaφ notches, each having energy added to either or both sides of the reject frequency. When its rejection and boosting energies and bandwidths are carefully chosen, the filter system can remove unwanted energy with little compromise or alteration to sonic balance. Reject notches, for this purpose are sharp, have high attenuation and are generally high-Q. The side band compensations or restorations are best made from boost responses at both sides of the rejection. However, a one-sided compensation may work better for speakers having combined response roll off and interference energy problems. The unsymmetrical boost helps flatten the frequency response. Other aspects are the same. Compensations can be very small, have low Q, and the average pink noise energy in a one-half to one octave band centered to the correction is constant when the process is on or off.
Decay from sounds can perceptually shift to low-Q side-band frequencies. Consequently, a double-tuned alignment for better immediate transient response settling is preferable to a one-sided or single-tuned boost method. The resulting composite filter can be carefully tuned and scaled so that it can be silently tuned over a useful frequency range. Without weighting, the small response losses on either side of the correction contribute to a nasal sound. The coloration may be subtle but when more corrections are used the losses can overcome any advantages. This is particularly true if the response is just made flat, as it might with standard-practice equalization. Weighting eliminates the compromise and allows multiple corrections to be more effective and free of sonic interaction and also eliminates loss when unintentional correction is applied to a speaker having different behavioral properties.
For either implementation, neutral weighted response notches can be made up from resonant and anti-resonant responses added to the signal. With reference to FIG. 13, a correction element might incorporate a single high-Q notch, whose frequency is centered on the behavior mode. One low-Q boost response is placed at the same frequency to provide the compensating equal-weight energy. The circuit portion of FIG. 13 shows a practical combination of an active circuit notch and passive LRC boost resonator in a feedback path. Both parts create the weighted response notch. However, the tuning range is limited, and the low-Q boost is likely to be audible, since the human hearing perception can resolve transient sounds decaying to a low-Q resonance.
A better alternative is to use two low-Q resonant boost responses, each tuned and placed at one or both sides of the high-Q notch. Figure 14 shows an example made from four tunable bi-quad resonators or state variable filters. Two of the filters create close spaced high-Q notches and the other two provide the boosted low-Q energy at the outer high and low sides. These state variable filters are easily created with DSP processors, and they maintain constant Q and notch depth over a wide tuning range. The analog system creating the responses shown in FIG. 15 has eight precision variable resistors ganged on a single shaft to tune the WCC1 or weighted notch parameter. Figure
13 shows a circuit for one of four sections. Figure 15" shows response curves for two different Q settings and these correlate to those in FIG. 4d. The double-tuned boosts can be aligned to yield a faster and smaller settling response to transients. A double- tuned notch like that from the figures offers similar advantages and also provides a dead- band or band-reject capability to accommodate manufacturing tolerances from one speaker to another. Side frequency boost is still needed and double-tuned resonators are best used.
Other variations and simplifications can be made when adjacent behavioral modes have similar properties, as is likely with most speakers. Two or more rejection notches can share Q and amplitude settings as well as compensation boost. Combinations include two notches with three boosts, two notches with two asymmetrical boosts, three with two, etc. A single low-Q boost with a frequency halfway between two notches can be used. Three low-Q boosts with frequencies below, above, and between are a better variation. For all of these implementations, the notch depth is often great and the side frequency boost is usually small. Usually, the overall energy response to random noise averaged about the compensation region is made to be the same or slightly higher than without correction.
Delayed Interference or All-Pass - A hybrid analog-digital CCD device can create a small, convenient tunable delay. Though performance may be poor, they can be connected or configured like the example in FIG. 16 to provide interference-like behavior. The circuit can create approximate conjugate responses to wavelength related reflection and transmission behavior from walls, tables and the insides of speaker enclosures or other parts of the transmission path or system. The circuit can be set to create an inverted comb filter or additive interference like response which would be opposite in time, phase and amplitude to subtractive interference loss from reflecting surfaces. The correction boosts where interference takes away. The circuit can also be adjusted to have a comb filter like response to cancel additive energy from reflections within the speaker enclosure. Better time delay interference filters or comb filter like responses can be made from DSP processes. Both the analog and the DSP can be configured to be relevant to the physical reflection model and like other parts of the correction system, are controlled by parametric adjustments related to physical behavior. The delay interference path filter has controls relating to dimensions, surface absorption, and the amount of interference correction needed.
With reference to FIG. 16, Td relates to the difference between the direct path from the speaker to listener and the longer bounce path also from speaker to listener. Td also relates to the out and return path between the speaker and an opposite surface inside an enclosure. A wall behind the speaker can be characterized the same way. Larger Td gives a larger distance. RC relates to surface roughness or absorption at high frequencies. Larger RC product for greater loss or faster attenuation of upper frequency comb filter response and correction. The control Rl adjusts the magnitude of the response or correction. CW direction increases subtractive responses while the CCW position near the + input to the op amp gives maximum additive responses.
The circuit produces an interference response whose amplitude decreases with frequency. This matches or simulates losses of absorption materials of practical speakers. Much of the irregular response from small speakers can be experimentally changed to something that appears to be more easily processed by the compensation system. Usually, the delay setting to do this matches the back arrival wave relationship expected from the speaker enclosure. When it does, this one adjustable parameter equals a multitude of conventional response-leveling processes.
Figure 17 is an all pass or phase shift network. Its frequency response is flat however its output is in phase and high frequencies and out of phase at low frequencies. The circuit alters transient response without changing frequency response. The variable control increases the transition frequency as it is turned CW. This element is useful to correct group delay and other transient related responses.
As previously mentioned, mechanical disturbances produced by speakers are often audible, yet invisible or hard to interpret from response measurements made using a frequency sweep and microphone. Traditional compensation methods using a deep notch usually result in either a nasal sound or undesirable balance aberration. The weighted compensated notch filter of the present invention solves this problem and yields some other advantages as well. When two drivers (woofer and tweeter) are crossed over by just a capacitor or by circuits that overlap frequencies, one or both drivers can have interference compensation without perceptual loss to the other. The same applies to different listening positions. One position having a bad response can be compensated without compromising the sound for other listening positions. The correction is hidden by the weighted side energy. Since good listening positions are not compromised by the correction, a wide range of listening positions can have good sonics. This feature is particularly useful to horn-type loudspeakers for theater sound, where slightly different corrections are needed from one installation to another. By using default optimization for a class of speakers or construction features, parametric control and adjustment is simple and intuitive.
Some of the most important behaviors of loudspeakers (with respect to acoustically perceptible effect) cannot be modeled or implemented from traditional methods. Such behaviors include interference and resonant coupling, as well as nonlinear consequences from such behaviors. In addition, other spatial factors related to stiffness of moving parts and high frequency de-coupling for motions away from a driving voice coil need to be considered. Any of these can create source movements, delayed energy release and phase error to binaural hearing. Often, such destructive responses can be invisible or very difficult to interpret from traditional microphone-and- spectrum-analyzer calibration methods.
An example of a parametrically addressed compensation for a specific physical effect is compensation for mechanical de-coupling in large full-range speakers. Such speakers are usually designed to have the entire cone move at low frequencies. At high frequencies, only the inner part of the driver is the primary active radiator. The rest of the cone is intentionally de-coupled to attenuate its nodal breakup. This design choice changes the position of an equivalent radiation source. A linear correction to move high- frequency radiation forward in time uses complex pass filters to create band-limited delay of the lower frequencies. Then, as frequency increases, a latent delay decreases thereby maintaining a phase match to the response order of the speaker. Some group delay distortions can be removed this way. A physical dimension from the speaker along with attenuation and speed-of-sound properties of the cone can yield information to specify a correction from a dedicated filter process. However, the delay effect and de- coupling frequencies can be experimentally determined to yield parameter values. If some of the speaker parts change size or attenuation properties, new values can be extrapolated.
An additional example of a parametrically addressed compensation, which is difficult or impossible to compensate using traditional methods, is compensation for Doppler modulation in small speakers. Computer and multi-channel sound systems require small speakers to play very loud. The resulting combination of fast, high- displacement cone motions can impart an additive or subtractive velocity to the sound reproduced. The low-frequency movements of the speaker cone impart a Doppler modulation effect by moving the effective high-frequency radiating area. The effect is quite annoying and creates a sound typical of small speakers struggling to play loud. When radiating area, frequency, and acoustic power output are known, a reasonably accurate calculation of the resulting cone motion and Doppler radiation factor can be made (see FIG. 5). An opposing alternating time delay is created for correcting the loudspeaker response. This multiplicative or non-linear process can make the equivalent radiation source steadier so that non-linear distortion is reduced. A good behavioral model of the speaker and a single dimension parameter can specify the correction. Any such open-loop or feed-forward non-linear correction is very difficult to accomplish. Modeled time-delay modulation is much better as it provides the exact conjugate response correction. The example is included here because cone motion from bass drivers is reasonably predictable from the model, and instantaneous correction from DSP methods will become more practical in time. Experiments were performed by using CMOS-type analog delays operating from voltage-controlled oscillator clocks. One path compensates for latency from both "bucket brigade" devices and the other receives the variable clock to produce delay modulation. For nodal flextures, wave interference and non-linear motion situations, the removal or attenuation of behavioral responses by using the weighted-notch process is a good compromise. The weighted compensation can be parametrically moved to where it is needed. If needed, its severity can be modulated to best match program dynamics, distortion from the loudspeaker, and human critical-band hearing perception. Additional bass output capability and response extension can be had when the dynamics of the audio signal are detected and used to change parameters or hidden compensations. This technique can work for any speaker system operating from the improved method.
However, if parts of the speaker are designed to require the dynamic compensation, additional performance features are possible. An adjustment list or bit map intended for the specialized system can have the same parameters and adjustments as the general-purpose system, i. e. , the controls have features in common. Thus an electronic system with a compensation system is capable of receiving instructions to compensate and optimize a variety of speaker models and products which can be attached to it, both generic speakers and those designed specifically for use with the compensation system. When needed, the system can improve clarity, imaging, and bass extension without changing sonic balance, i. e., the sonic signature of a product line is maintained.
The adjustment effect that parameters create are described or represented by a symbol or acronym as included in the previously described table. In this way, mathematical statements, circuits, loudspeaker design features and other specialized language are consolidated to lists that a programmer or user can intuitively interpret. Then, response-curves, behavioral features, wavelength relationships, as well as other things important to human perception, become relevant to the process model used for design and/or compensation of a loudspeaker system. Compensation is simplified since interactions between design and performance changes and basic relationships are meaningful and intuitive.
Settling and nodal compensation parameter adjustments include frequency in Hz, Q as a number, and rejection in dB. Since multiple-order nodal behaviors are possible, the Q and rejection adjustments are more likely to have similar values for more than one compensation frequency. Controls can be linked so that two or more frequencies in Hz can specify corrections for nodal behaviors sharing a mechanical or interference property in common.
Bell-mode compensation for speaker cones provides a good example. Several methods can determine these frequencies. Multiple nodes or wave-related interference can be observed using sine wave excitation and optical interferometry. Waterfall plots from MLSSA-type stimulus, as shown in FIG. 7, or a differential microphone probe can be interpreted to reveal settling energy from breakup. These behaviors are audible and the hidden compensation process can be manually or slowly swept in frequency to reveal sonic changes during pink-noise reproduction. The experimental method requires caution and experience since room reverberation can imitate the mechanical sounds. Correlation between the three techniques is good, and when several frequencies from similar causes are determined, composite weighted notches of similar Q and shared boost parameters simplify the correction.
The above parameters and their adjustments change a configured compensation for a specialized behavior of the loudspeaker. Some processes are inherently confined to a narrow range of frequencies where a particular kind of behavior is most likely to occur from the loudspeaker system. Others affecting time and response slopes cover a wide spectrum. These dedicated operations are isolated enough from each other that interaction between them is small. Selected parameters can be changed without affecting others. In addition, the data requirements are modest for useful adjustment resolution.
As described in the foregoing speaker example, controls adjusting the compensation system are related to physical parts and acoustic properties of the speaker. Other speakers of similar, but not exact design or construction can be improved in the same manner. The control or specification information to do so has the same simple, intuitive language. A small inexpensive speaker could be substantially improved with 16 parameter adjustments and a few default settings. To match the complex response from this system, a conventional multi-band or graphic equalizer would need well over 100 band, and much more control information.
The compensation system uses slopes, crossovers, and other mathematical functions to create predicted corrections for characteristics of the speaker. These operations are controlled by coefficients or points, and by process commands instead of from documenting and calculating responses to linear plots. Since each process has a specialized nature, the range of frequencies, amplitudes, Qs, etc., confine parameter ranges to small portions of a control space. A three-word code can create an accurately placed resonator or complex weighted response notch subsystem. In the case of 8-bit code words, this map or information sequence gives 128 points for a logarithmic frequency decade, +/- 20dB in l/2dB steps for amplitude, and 16 Q settings, as well as space for process commands and control formatting. For this example, 384 points or frequencies in the audio band would be available for setting shaφ rejection notches and weighted compensations. Bitmaps for other parametric controls and process commands may require less resolution, thus providing even greater economy. This compact specification feature could be used for bar-code installation of the compensation system to correct a specific speaker design or for dynamic control of processes from codes hidden in data streams such as used in HDCD systems. As described in detail below, portable devices, such as hearing aids and communication systems benefit when the scope of processed information is reduced. For many applications, 384 points or frequencies in the audio band might be chosen for a successful process incoφorating ten basic operations, i. e., shelves, notches, compensations, cutoff filters, delays, etc. Process scale increases very rapidly with resolution: rejection notches can be sharp and need accurate tuning, interference compensations are inherently complex and speaker responses from a traditional measurement practice reveal little useful information to simplify processing. Unless the compensation system is designed to recognize and process sub-system or modeled responses from curves, the corrections must be done on a point-by-point basis. Even a good response correction done this way requires substantial process power. The scope of conventional processing widens when time, phase, and settling issues are considered. For this situation the number of filters or processes needed to resolve a useful correction response anywhere in a three-dimensional grid (such as a waterfall plot) can be impractical. Some economy is possible when filters or processing power are allocated to those portions of the grid requiring higher resolution and more correction activity. Even these efforts fail to achieve the hidden or compensated correction benefits of the compensation system. A good example of this difficulty is evident from FIG. 6. The compensation system has 8 notches, one weighted notch for node correction, and a low frequency boost crossover and shelf. The high frequency drop provides a crossover to a tweeter. Clearly, the difficulty of plotting points and creating a response synthesis is evident. The compensation system creates this conjugate curve from 24 adjustments (Lx, Ls, LP, W0, Q0, |A|0, Wj through W7, lA^ through |A|7, WCC1, and one default Q setting).
A strategy similar to compensating the removal of in-band signals can be used for the highest and lowest frequencies. For example, distortion caused by excess cone motion from bass energy can be less objectionable by reducing the input to the speaker. One way to do this is to restrict the low frequency response to a practical value. Quite likely, the speaker would have been able to make feeble bass reproduction below the cutoff, provided the program material does not mask the low bass signals. Wide dynamic range program material can force the speaker to produce perceivable output at these frequencies. Unfortunately, the resulting feeble output is frequently covered up by other sounds in the same perceptual band of human hearing. Hence, most of the time an extended response from the speaker is useless and only adds distortion and consumes amplifier power.
The weighted response correction of the compensation system can be applied to the audible side of either a low or a high frequency broadband or cutoff rejection or filter. If done carefully, the perceptual response appears unaltered and can be made to sound extended as it was before filtering. Large systems intended to reproduce high- power, sub-audible or infrasonic energy require a different approach, although the same method applies.
The compensation system combines a loudspeaker model and conjugate process to create a zero-phase filter whose acoustic output has low group delay distortion. For this application, the peaked response not only complies with the standard practice but is used in the alignment to help improve group delay and becomes part of a hidden compensation that allows the band limiting feature to be turned on or off.
When neutrality like that described above is chosen, the compensation system can be made to change its cutoff depth and compensating energy with minimum audibility. This feature allows the compensation system to track or modulate from changes of volume control settings, power levels, or program conditions competing for perceptual bands. In this manner, the bandwidth restriction can force more power to the speaker before distortion sets in. Since audible energy is now rationed a smaller amplifier can produce the same playback volume. These factors have economic importance. Speakers can have parts designed so that the system can benefit from the compensation system. They would have shorter voice coils and lighter-weight cones to produce higher acoustic output from an amplifier. Efficiency is higher, but mechanical behavior is often compromised and the acoustic output from such a design tends to rise with frequency. Without correction the speaker sounds harsh and shrill and therefore must be compensated. However, once these changes are corrected by the compensation system, the speaker plays louder, can be smaller, and a lower-powered amplifier can be used.
If virtual bass extension is chosen, the peaked or compensated response is moved in frequency with a carefully worked out strategy. Process settings and the related acoustic peaking frequency at a band edge becomes dependant on bass content of the program material, power reserve of the amplifier, and motion capability of the speaker. When playback level is high, and low frequency energy is strong, the peaking response is moved up in frequency to maintain a reasonable cone motion and distortion performance. Most entertainment systems have equalizers, tone controls, and other user- operated or initiated features. Acoustic visibility is needed. The compensation system works best in tandem with these and can improve their performance. Once the speaker system has the more idealized radiation behavior provided by the compensation system, various response leveling systems will not have to sort out or guess which parts of a measured response taken from a microphone originate from the speaker or from the room. The compensation system can more effectively rule out inappropriate equalizations from these response leveling programs which might destroy phase response or be inappropriate for other listener positions. Tandem operation also assures removal of distracting mechanical sounds caused by responses that are unidentifiable by traditional methods. Human binaural perception is good at perceiving, recognizing, and localizing these sounds. Once they are removed, the traditional equalization methods can boost high frequencies without added harshness, and low frequencies without box boom or muddy sounds characteristic of minimal construction.
For the compensation system, specialized analog functional block circuits can make simple practical systems. Response ranges for their adjustable parts can be predicted from the conjugate model so that parallel signal paths and multiple shared functions are possible. Much fewer active devices are needed in a signal path, thereby reducing costs and distortion. Some time-related correction is possible from all-pass filters but other delay operations are impractical.
Exemplary analog and DSP implementations of the compensation system in a loudspeaker context are provided in appendices B and C, respectively. Descriptions of other applications of the compensation system follow.
Communication System - Communication systems can be subject to unwanted narrow-band noise or tones at fixed or varying frequency. Quite often some time latency is available allowing a subsystem to identify and track such tones. When it is not practical or possible to create an out-of-phase signal to remove the disturbance the compensation system achieves an effective result. Frequently, it is possible to track the disturbance with the parametrically moveable weighted response notch. Unless an intelligence signal has the same frequency as the one being rejected, the correction will be effective yet not degrade or change the sound. Frequently, communication systems have transducers such as microphones, headphones, and speakers as part of the sound reproduction system. These elements could have undesirable responses that can be compensated individually, or collectively as a system. One or more processors can be placed anywhere in the signal chain. They can be controlled or programmed to compensate a multitude of component part mixes, such as transducers, signal paths, human hearing requirements, and the like. To set up such a system, control parameter information may be identified or accessed by hidden codes in the signal path. Auxiliary channels, as well as other means, can be used to convey this information. Since the compensation system uses this information efficiently to create very complex responses, the correction process can be installed in many systems. Examples include computer speakers, telephone systems for hearing impaired, and mobile communications. For these systems, the processors can be external or not part of the end user appliance.
Hence, the compensation system can be programmed to a particular model of appliance and externally activated. Part, all, or none of the processor can reside with the appliance.
Hearing Aid - Many hearing difficulties arise from damage to hair cells within the auditory nerve. Frequently people suffer tinitus or head ringing, and have difficult understanding conversations in crowded noisy rooms. Sometimes a closely spaced group of cells corresponding to a narrow frequency band has had mechanical damage causing an excessive nerve response to high intensity stimulus. This action often sounds discordant and painful. It may cause disruption to a hearing feedback path to and from the brain, so as to initiate premature protection functions, thereby aggravating the unpleasant sensation. Since the stimulus causing the mechanical motion is in a range of frequencies easily defined by medical test routines, the parametric weighted notch filter can be easily tuned to the same frequencies to block sound transmission that excites these cells. If the additive weighting is set up properly for the individual the perceptual loss to other sounds is reduced. In a typical situation the notch must have a band reject characteristic which may have to become wider with sound pressure level. The compensating side energy tracks these changes to reduce the intelligibility loss to other sounds. A system designed to perform this correction can be more effective and its specialized processing might take up less battery power than general-puφose response contouring methods. Watermark Identification - A recording can be made with known frequencies removed by a shaφ notch. If the same recording needs to be identified later a system can be made to search for the known missing frequencies. One can expect flutter, noise, and unpredictable clock rates to shift dead bands and to create a multitude of difficulties. A recording may use music signals to define operating frequencies and timing of encoded security notches. Clock dependency is reduced and number keys are used to prevent someone from finding these frequencies and altering their puφose. During playback, key identified parts of the program initiate decoding parameters used for verification. Like the communication system previously described, the recorded notch should be silent or hidden as best as possible and it is likely to jump from one frequency to another. The parametrically controlled weighted compensation method is ideal for this application, and the combination of keyed frequency jumping and hiding provides for an effective security system.
Feedback Elimination from Sound Systems - Large sound reinforcement installations, phones, and other systems involving the simultaneous acquisition and reproduction of sound are subject to feedback. Usually, a microphone picks up some part of a reproduced acoustic signal and adds to the signal to cause oscillation. Sophisticated DSP parts of speaker phones can sort out room echoes and phase relationships of cross talk to clarify sound transmission and eliminate feedback. Frequency shifters randomize feedback phase to prevent a slow buildup of howl or high- Q loose-coupled oscillation. Sometimes, the latency from these methods interferes with stage performance or synchronization. Tunable weighted notches can be set to sensitive frequencies to eliminate oscillation without significant loss to sounds. Double or multiple-tuned versions have little interaction with each other, and the inherent dead band makes tuning out feedback much easier.
CD Player - A typical electronic system, operating in either the digital or analog domain (or both), might combine intentional user adjustments and the compensation system. Parts descriptions, mathematical models, measured data, and human preference information may be combined and incoφorated into its design. Once parameters are defined and their coefficient values are determined an organized group of numbers can program an electrical or mathematical system to perform specific correction response for different shapes and sizes of loudspeakers. The parameter list, and even the individual correction modules, can be downloaded to a digital signal processor in a CD player or other device. This operation can be done at any time, so that it provides a programmable upgrade. It can be activated by bar code, remote control, downloaded from a computer, or installed to dedicated player/speaker combinations. While several particular forms of the invention have been illustrated and described, it will be apparent that various modifications can be made without departing from the spirit and scope of the invention.
APPENDIX A
FIGS. Al, A2 and A3 show possible implementations for the low-pass filter (Lp) and the high-pass filter (HP) cut-off filters. The order of these particular filters is kept small to support a low-MIPS implementation. FIG. A4 shows a possible implementation for the high and low shelving equalizers. These equalizers are used for Ls and Hs. FIG. A5 shows a parametric equalizer implementation usable for boost or cut applications. Combinations of such equalizers can be combined, as shown in FIGS. A6 and A7, to build the compensated notch effect.
Digital Low-Pass Filter Implementation *1
Define sampling equency
Figure imgf000035_0001
A = 1.411 B:=A
Define Transfer Function (1 st column is numerator coefficients in transfer function and 2nd column is denominator coefficients In transfer function). So this filter is a 2nd order IIR.
Figure imgf000035_0002
1.411 1
D = 1.411 0.991 0 0.832
Plot frequency and phase response of the fitter x.: = 0,.00L..5
Gx):=|gaiπ(D,x)|
FIG. Al PlqUaim-Pass Filter ,1
Figure imgf000036_0001
B:=A
Define Transfer Function (1st column is numerator coefficients In transfer function and 2nd column is denominator coefficients in transfer function). So this filter Is a 2nd order //ft
Figure imgf000036_0002
Calculate gain compensation PK:=. 4
(4- 2-FQ-F2) κ:=-L PK
K = 0.909
Plot frequency and phase response of the filter x.:=0,.00l..5
G(x):=K|gain(D.x)|
FIG. A2 Digital Low-Pass Filter Implementation ¥Z (one-zero)
Define sampling frequency Fs := 44 IOC
Figure imgf000037_0001
Oe fine Filter Q S0O0 1-10 x 4 103 1 5'io 2*10 q '- = 10
Figure imgf000037_0002
B :=A
Defha Transfer Function (1st column is numerator coefficients in transfer function and 2nd column is denominator coefficients \ transler function). So this filter b a 2nd o orrddeerr 1 HIRR
Figure imgf000037_0003
0 1 0.04 -1.891 0 0.972
Plot frequency and phase response of the filter x := 0, ,001.. .5 3[ x) r=| gain(D, xJ j
FIG. A3 Digital Shelving EQ section based on an All-pass filter section
Define sampling frequency
Fs = 4410C
Define critical frequency
Fc = IOOOC
Normalized critical frequency c := 2 π — Fs
Define gain/cut k := 4
Define Filter parameters c ] tan gamma :
(wc . 0 1 0 2 03 04 0_5 — -t- 1 2
Define Transfer Function (1st column is numerator coefficients in transfer function and 2nd column is denominator coefficients in transfer function). So this filter is a 1st order IIR.
Figure imgf000038_0001
To produce desired parametric EQ embed all-pass section in below structure
Figure imgf000038_0002
In a DSP implementation, the filter output is computed as per the above signal flow Below we calculate the overall transfer lunction of the above system by transforming the numerator of the all pass section as necessary
FIG. A4 (Sheet 1 of 2) D:=A
G:=D .<!> extract denominator
,<0>
F:=D extract numerator
Figure imgf000039_0001
FIG. A4 (Sheet 2 of 2) Digital Notch Parametrfc EQ section based on an all-pass section
Delme sampling frequency Fs :=44 10C
Define critical frequency
Figure imgf000040_0001
Define Filter parameters
Figure imgf000040_0002
0.821 1 A = -1.29 -1.29 1 0.821
Plot frequency and phase response of the fitter x :=0, .001..0.5
G(x) :=| gain(A,x) |
To produce desired parametric EQ the all-pass section is embedded in the below structure:
1+K
Figure imgf000040_0003
In a DSP implementation, the filter output is computed as per the above signal flow. Below we calculate the overall transfer function of the above system by
FIG. A5 (Sheet 1 of 2) transforming the numeralorof the all-pass section as necessary. D:=A
G:=D extract denominator
F:=D" extract numerator
(I-k)
M :=
Figure imgf000041_0001
Magnitude Response:
FIG. A5 (Sheet 2 of 2) Digital Implementation of a Weighted Notch #1
Consists of 3 parametric EQ section designed using the procedure described in "Notch/Parametric EQ section based on an all-pass section"
2 low Q gam section surround the critical frequency notch
For compensation section # 1 and #2 (D1 and D2 respectively) Q is 2 and k is 1.5 resulling in the below transfer functions. The resulting filters are two 2nd order MR filters where column 0 represents the numerator and column 1 represents the denominator.
1 076 1
D l := - 1.283 - 1.283 0.619 0 695
Figure imgf000042_0001
For critical frequency section #3 (D3 below) Q is 10 and k is 0. The resulting filter is a 2nd order II R filters where column 0 represents the numerator and column 1 represents the denominator.
Figure imgf000042_0002
Plot of the overall frequency response of the 3 IIR filters cascaded
Figure imgf000042_0003
H(x) := 20-log(GKx)-G2Cx)-G3(x))
Figure imgf000042_0004
FIG. A6 Digital Implementation of a Weighted Notch #2
Consists of 3 parametric EQ section designed using the procedure described in
'Notch/Parametric EQ section based on an all pass section- One medium Q gain compensation section centered around two notches
For compensation section H I (01 below) Q is 4 and k is 4 resulting in the below transfer function The resulling fillers is a 2nd order IIR filters where column 0 represents the numerator and column 1 represents the denominator
Figure imgf000043_0001
For critical frequency notches sections #2 and #3 (D2 and D3 below respectively) Q is 10 and k ts 0 The resulling filters are two 2nd order IIR filters where column 0 represents the numerator and column 1 represents the denominator
Figure imgf000043_0002
Plot of the overall frequency response of the 3 IIR filters cascaded: x :=0, .000 0.5
Gl(x) :=| gain(Dl.x) |
G2(x) :=| gain(D2,x) j
G3(x) :=| gain(D3, x) j
H(x) :=20 !og(Gl(x) G2[x) G3(x)) (cascaded response)
Figure imgf000043_0003
FIG. A7 APPENDIX B
Figure Bl is a block diagram of a compensation system used to compensate a small bookshelf speaker having a 5-inch bass driver and 3-inch tweeter. The speaker is characterized as follows:
Woofer: dome = 4.33 k (notch with LC) cone = 4.9 k (compensated notch only) edge of cone = 2.8 k (active notch)
Tweeter: dome = 15.1 k (no compensation) cone cr = 11.6 k (active notch) cone cr = 9.32 k / 9.45 k (damp compound) W0 = 1.38 k (LCR notch)
Fourteen adjustments are provided. FIG. B2 shows circuits used to create L*. Hx> Ls, Hs> Lj., and HP filters and parameters adjustments. A lower frequency cutoff peak was added to create response character of an 8 inch bookshelf system. For this circuit, Q and peaking amplitude are set by the components marked by square boxes. FIGS. B3 and B4 show W0 notch sections and representative tuning for the speaker. W0... and |A| in dB are adjustable, while a resistor set Q. Two groups of these make four adjustments. FIG. B5 shows a single low-Q boost. Adjustments for boost and frequency are provided by the op amp section. FIG. B6 is an all-pass equalizer used for time correction. The all-pass equalizer combines outputs from the six active process circuits.
Figure imgf000045_0001
FIG. Bl
SLOPE EQ AND BANDPASS FILTER ADJUSTED WL=65Hz, 44Hz (PARALLEL CAPS)
WH= 17kHz
Figure imgf000046_0001
E/G. 52
FIG. B3
+6db re INPUT
Figure imgf000047_0001
0.0015=3.2-3.6k (2.5k->6.8k) 0.0033=1. ->1.7k (1.2k->3.3k) 0.0047 900- 1.2k (800->2.2k) 0.15=120 (80-220)
LOWQ R|A|=47k||33k RQ=68k||l00k FIG. B4
Figure imgf000047_0002
FIG. B5
Figure imgf000048_0001
0.033=270-> 1.4k
0.0068
700Hz opt
@ 3/4 max WQ
Figure imgf000048_0002
APPENDIX C A computer adjusted DSP compensator was implemented using a standard PC and a Motorola EVM56362 DSP evaluation board. Source code and application notes follow.
Speaker Tuning Application Note
The speaker tuning application is written as a Windows OS 32-bit application using the object-oriented MFC application framework (please refer to the documentation of MFC that is included with Microsoft Visual C++ development environment). The application has a dialog interface. The main dialog class, CTabDialog, is a subclass of the MFC CDialog class. The CTabDialog class implements a "tabbed" dialog interface. Each tab in the dialog is a subclass of the MFC CPropertyPage class. Each tab represents different aspects of the speaker correction algorithm. The following is a list of tab classes:
CMainPage which implements UI for pre and post volume controls amongst other things
CShelvPage which implements UI controls for low and high shelving equalization filters
CCutoffPage which implements UI controls for low and high peaking cutoff filters
CNotchPagel and CNotchPage2 which implements UI controls for a number of notch filters (to for example limit resonance in the speaker)
CStWaveRejectPage which implements UI controls for a set of filters which can limit standing waves in the speaker cabinet
CDBNotch which implements UI controls for a double-tuned notch filter
CAllpassPage which implements UI for a 2" -order allpass filter
Each adjustable parameter on a tab page is represented by an instance of the CSlider class. Each UI slider has a range of 4096 discrete values. When a user manipulates a UI slider a message is sent from the tab page to an instance of the CDSP56Manager class. In this class, the appropriate calculation takes place to transform the linear input value into one or more values necessary to compute the transfer function represented by the user settings. These computed values are transmitted to the DSP using an I2C serial connection. The DSP executes the calculations necessary for the real-time implementation of the above-mentioned transfer function. The DSP is capable of computing a series of filter calculations in real-time to allow the total cascaded transfer function of all the speaker correction filters to be realized. The DSP can receive analog or digital input data and transmit processed analog or digital output data.
18
50
Speaker Parameter File Input and Output Logic
The tab dialog object instance receives messages (from the Windows OS) in response to user action in the application menus
Figure imgf000051_0001
8
51
Example of a Property Page UI to DSP connection logic
The property pages of the
TabDialog receive mapped messages (from the Windows OS) in response (o user actions
Figure imgf000052_0001
// COMPortChooser cpp implementat ion file //
(( include stda fx h '
(j include " sa h"
((include ' COMPortChooser h" fti fdef _DEBUG ((def ine new DEBUG_NEW flunde f THIS_FILE static char THIS_FILE [) = FILE flendi f
///////////////////////////////////////////////////////////////////////////// // CCOMPortChooser dialog
CCOMPortChooser CCOMPortChooser (CWnd* pParent /* -NT LL*/) CDialog (CCOMPortChooser IDD, pParent)
{
//{{AFX_DATA_INI (CCOMPortChooser)
// NOTE the ClassWizard will add member initialization here //) }AFX_DATA_INIT
void CCOMPortChooser DoDataExchange (CDataExchange* pDX)
(
CDialog DoDataExchange (pDX) ,
//{ {AFX_DATA_MAP (CCOMPortChooser)
// NOTE the ClassWizard will add DDX and DDV calls here
// } )AFX_DATA_MAP }
BEGIN_MESSAGE_MAP (CCOMPortChooser CDialog)
// { {AFX_MSG_MAP (CCOMPortChooser)
ON_BN_CLICKED(IDC_RADI01, OnRadiol)
ON_BN_C ICKED(IDC_RADI02, 0nRadιo2)
ON_BN_CLICKED(IDC_RADI03 OnRadioJ)
ON_BN_CLICKED(IDC_RADI04 OnRadιo4)
//}}AFX_MSG_MAP END_MESSAGE_MAP ( )
///////////////////////////////////////////////////////////////////////////// // CCOMPortChooser message handlers void CCOMPortChooser OnRadiolO
{
// TODO Add your control notification handler code here whιch_port = 1 , } void CCOMPortChooser OnRadιo2 ( )
{
// TODO Add your control notification handler code here which_port = 2 ,
void CCOMPortChooser OnRadιo3()
{
// TODO Add your control notification handler code here whιch_port = 3
void CCOMPortChooser OnRadιo4()
{
// TODO Add your control notification handler code here whιch_port = 4 BOOL CCOMPortChooser: :OnInitDialog ()
(
CDialog: :OnInitDialog () ;
// TODO: Add extra initialization here which_port = 3; return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE
// CutoffPage cpp implementation file //
((include "stdafx h" ((include "sa h" ((include "CutoffPage h" ((include "DSPS6kManager h"
Kifdef _DEBUG
((define new DEBUG_NEW ffundef THIS_FILE static char THIS_FILE[) = FILE
(fendif
///////////////////////////////////////////////////////////////////////////// II CCutoffPage property page
IMPLEMENT_DYNCREATE (CCutoffPage, CPropertyPage)
CCutoffPage: : CCutoffPage () : CPropertyPage (CCutoffPage: IDD)
//{ (AFX_DATA_INI (CCutof Page) //) )AFX_DATA_INIT
}
CCutoffPage: : -CCutoffPage ()
{
} void CCutoffPage: : DoDataExchange (CDataExchange* pDX)
{
CPropertyPage: : DoDataExchange (pDX) ;
// { {AFX_DATA_MAP (CCutoffPage)
DDX_Control(pDX, IDC_CHECK6, m_BypassSecondButton)
DDX_Control (pDX, IDC_CHECKS, m_BypaεsFirstButton) .- DDX_Control (pDX, IDC_SLIDER6, m_HiBoostSlider) ,- DDX_Control (pDX, IDC_SLIDER5, inHiQSlider) ; DDX_Control (pDX, IDC_SLIDER4, m_HiFreqSlider) ,- DDX_Control (pDX, IDC_SLIDER3, m_LoBoostSlider) ; DDX_Control (pDX, IDC_S IDER2, m_LoQSlider) ,- DDX_Control (pDX, IDC_SLIDER1, m_LoFreqSlider) ; // ) )AFX_DATA_MAP
BEGIN_MESSAGE_MAP (CCuto fPage, CPropertyPage) //{ {AFX_MSG_MAP (CCuto fPage) ON_WM_VSCROLL ( )
ON_BN_CLICKED(IDC_CHECK5, OnBypassFirst) ON_BN_CLICKED(IDC_CHECK6, OnBypassSecond)
//))AFX_MSG_MAP END_MESSAGE_MAP ( )
///////////////////////////////////////////////////////////////////////////// J I CCutoffPage message handlers
BOOL CCutoffPage. OnlnitDialo () {
CPropertyPage. -OnlnitDialog ( ) ;
// TODO- Add extra initialization here m_LoFreqSlιder SetRange (0, CONTROL_RANGE) , m_LoFreqSlιder SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kNotchGFreq) ) , m_LoFreqSlιder SetTicFreq ( (CONTROL_RANGE+l) /16) , m_LoQSlιder SetRange (0, CONTROL_RANGE) , m_LoQSlιder SetPos (CONTROL_RANGE-g_DSPManager- >GetParamValue (kNotch6Q) ) , m_LoQSlιder SetTicFreq ( (CONTR0L_RANGE+l) /16) , m_LoBoostSlιder SetRange (0, CONTROL_RANGE) ; m_LoBoostSlιder Set Pos (CONTROL_RANGE-g_DSPManager- >GetParamValue (kNotchβBoost ) ) m_LoBoostSlιder SetTicFreq ( (CONTROL_RANGE+l ) /IS) , m_HιFreqSlιder SetRange (0, CONTROL_RANGE) , m_HιFreqSlιder SetPos (CONTROL_RANGE-g_DSPManager- >GetParamValue (kNotch7Freq) ) , m_HιFreqSlιder SetTicFreq ( (CONTROL_RANGE+1) /16) m_HιQSlιder SetRange (0 CONTROL_RANGE) m_HιQSllder SetPos (CONTROL_RANGE-g_DSPManager >Ge ParamValue (kNotch7Q) ) m_HιQSlιder SetTicFreq ( (CONTROL_RANGE+l) /16) m_HιBoostSlιder SetRange (0, CONTROL_RANGE) , m_HιBoostSlιder SetPos (CONTROL_RANGE-g_DSPManager-=-GetParamValue (kNotch7Boost) ) m_HιBoostSlιder SetTicFreq ( (CONTROL_RANGE+l) /16) ,
// g_DSPManager- SetCuto flFre (CONTROL_RΛNGE-m_LoFreqSlιder GetPosO )
// g_DΞPManager >SetCutoff1Q (CONTROL_RANGE-m_LoQSlιder GetPosO),
// g_DSPManager- SetCu of lBoost (CONTROL_RANGE-m_LoBoostSlider GetPosO )
// g_DSPManager->SetCutof f2Freq (CONTROL_RANGE m_HιFreqSlιder GetPosO),
// g_DSPManager->SetCutσ 2Q (CONTROL_RANGE-m_IUQSlider GetPosO)
// g_DSPManager >SetCutoff2Boost (CONTROL__RANGE m_HιBoostSlιder GetPosO)
return TRUE, // return TRUE unless you set the focus to a control // EXCEPTION OCX Property Pages should return FALSE ) void CCutoffPage OnVScroll (UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO Add your message handler code here and/or call default
CPropertyPage OnVScroll (nSBCode, nPos, pScrollBar),
Sleep(50) , ιf( (CSliderCtrl *)pScrollBar == &m_LoFreqSlιder ) g_DSPManager->SetCutofflFreq(CONTROL_RANGE-m_LoFreqSlιder GetPos ) , else if ( (CSliderCtrl *)pScrollBar == ->m_LoQSlιder ) g_DSPManager->SetCutofflQ(CONTROL_RANGE-m_LoQSlιder GetPosO) , else ιf( (CSliderCtrl *) pScrollBar == tra_LoBoostSlιder ) g_DSPManager->SetCutofflBoost (CONTROL_RANGE-m_LoBoostSlιder GetPos ) , else if ( (CSliderCtrl *) pScrollBar == &m_HιFreqSlιder ) g_DSPManager->SetCutoff2Freq(CONTROL_RANGE-ra_HιFreqSlιder GetPosO ) , else if ( (CSliderCtrl *) pScrollBar == &m_HιQSlιder ) g_DSPManager->SetCutoff2Q(CONTROL_RANGE-m_HιQSlιder GetPosO) , else if ( (CSliderCtrl *) pScrollBar == 4tn_HιBooεtSlιder ) g_DSPManager->SetCutoff2Boost (CONTROL_RANGE-m_HιBoostSlιder GetPos ) ,
void CCutoffPage OnBypassFirs O
{
// TODO Add your control notification handler code here mt state = m_BypassFιrstButton GetStateO & 0x3, g_DSPManager->SetBypasεSectιon (state, BypassHipass) ,
} void CCutoffPage OnBypassSecond O
{
// TODO Add your control notification handler code here mt state = m_BypaεsSecondButton GetState O & 0x3 , g_DSPManager- >SetBypassSectιon ( state , kBypassLopass ) ,
} Klf 'defined (AFX_COMPORTCHOOSER_H B5DS10E7_F7D5_11D2_9GEE_006097CDB9E2 INCLUDED_)
((define AFX_COMP0RTCHO0SER_H BSDS10E7_F7DS_11D2_96EE_006097CDB9E2 INCLUDED_
()l f _MSC_VER > = 1000
((pragma once ffendif // _MΞC_VER >= 1000
// COMPortChooser h header f i le
//
///////////////////////////////////////////////////////////////////////////// // CCOMPortChooser dialog class CCOMPortChoosei public CDialog (
// Construction public-
CCOMPortChooser (CWnd* pParent = NULL), // standard constructor mt which_port,-
// Dialog Data
// { {AFX_DATA (CCOMPortChooser) enum { IDD = IDD_DIAL0G3 },
// NOTE: the ClassWizard will add data members here //}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{ {AFX_VIRTUA (CCOMPortChooser) protected- virtual void DoDataExchange (CDataExchange* pDX) , // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation protected:
// Generated message map functions
// { {AFX MSG (CCOMPortChooser) afx_msg void OnRadiol O , afx_msg void OnRadιo2(), a£x_msg void OnRadιo3(); afx_msg void OnRadιo4() virtual BOOL OnlnitDialo () ;
//)}AFX_HSG
DECLARE MESSAGE_MAP ( )
);
//{ {AFX_INSERT_LOCATIONJ )
// Microsoft Developer Studio will insert additional declarations immediately before the previous line. ffendif // !defined(AFX COMPORTCHOOSER H B5D510E7 F7D5 11D2 96EE_006097CDB9E2 INCLUDED )
Klf 'defιned(AFX_CUTOFFPAGE_H 6F1S162S_D84D_11D2_96EE_006097CD89E2 INCLUDED_)
((define AFX_CUTOFFPAGE_H 6F1S1625_D84D_11D2_96EE_006097CDB9E2 INCLUT>ED_ β l f _MSC_VER > = 1000
((pragma once ff endi f // _MSC_VER ?= 1000
/ / Cutof f Page h header file
//
!iιιιιiiiιιιιιιιιιιιιι/ιιιιιι/πuι/ιιιιιιιιti!ttιιιtιιιιιιιιιιιi)iιιιιιιιιιι
II CCutoffPage dialog class CCutoffPage public CPropertyPage
{
DECLARE_DYNCREATE (CCutof Page)
// Construction public
CCutoffPage!) ,
-CCutoffPage () ,
//
,
Figure imgf000058_0001
// Overrides
// ClassWizard generate virtual function overrides
//{ {AFX_VIRTUAL (CCuto fPage) protected: virtual void DoDataExchange (CDataExchange* pDX) , // DDX/DDV support
//})AFX_VIRΓUAL
// Implementation protected-
// Generated message map functions
//{ (AFX_MSG( CutoffPage) virtual BOOL OnlnitDialog 0 ; afx sg void OnVScroll (UINT nSBCode, UINT nPos CScrollBar* pScrollBar), afx_msg void OnBypassFirs {) , afx_msg void OnBypaεεSecondO ,
//})AFX_MSG
DECLARE_MESSAGE_MAP ()
}
//{ (AFX_INSERT_LOCATION) )
// Microsoft Developer Studio will insert additional declarations immediately before the previous line
(fendl f // ' def ined (AFX CUTOFFPAGE H 6F151625_D84D_11D2_96EE__006097CDB9E2__INCIΛJDED_) ftlf ' deflned(AFX_ALLPASSPAGE_H F4767B24_11B3_11D3_96EE_006097CDB9E2 INCLUDED_
((define AFX_ALLPASSPAGE_H F47S7B24_11B3_11D3_96EE_006097CDB9E2 INCLUDED_
(f l f _MSC_VER >= 1000
((pragma once
(f endi f // _MSC_VER => = 1000
// AllpassPage h • header f ile
//
II CAllpassPage dialog class CTabDialog, class CAllpassPage public CPropertyPage
(
DECLARE_DYNCREATE (CAllpassPage)
// Construction public:
CAllpassPage () ,
-CAllpassPage 0 ,
// Dialog Data
//{ {AFX DATA(CAllpassPage) enum { IDD = IDD PP10 ) ; CButton m BypassButton; CSliderCtrl m_QSlider; CSliderCtrl m_FrequencySlider;
// Overrides
// ClassWizard generate virtual function overrides
//{ (AFX_VIRTUAL (CAllpassPage) protected: virtual void DoDataExchange (CDataExchange* pDX) ,- // DDX/DDV support
//)}AFX_VIRTUAL
// Implementation protected:
// Generated message map functions
//{(AFX_MSG (CAllpassPage) afx_tnsg void OnBypassO, virtual BOOL OnlnitDialog () , afx_msg void OnVScroll (UINT nSBCode, UINT nPos, CScrollBar* pScrollBar), afx_msg void OnPaintO;
//}}AFX_MSG
DECLARE_MΞSSAGΞ_MAP ()
CTabDialog *m_ParentWmdow; void SendStπngToUI (int which);
//{ {AFX_INSERT_LOCATION) )
// Microsoft Developer Studio will insert additional declarations lπ iediately before the previous line.
(fendif // Idefmed (AFX ALLPASSPAGE H F4767B24 11B3 11D3 96EE 006097CDB9E2 INCLUDED_) // AllpaεsPage cpp implementation file //
((include "stdafx h"
((include "sa.h"
((include "AllpassPage h"
((include "TabDialog h"
((include "DSP56kManager h" difdef _DEBUG ((define new DEBUG_NEW fjundef THIS_FILE static char THIS_FILE[) = FILE , ffendif it i iim 11 iiπiiiiiiπi 11 nun ui ii ii i mi i ii ii i π i ii in in 11 mi m i a a a i
II CAllpassPage property page IMPLEMENT_DYNCREATE (CAllpassPage, CPropertyPage)
CAllpassPage: : CAllpassPage 0 : CPropertyPage (CAllpassPage :: IDD)
{
//{{AFX_DATA_INIT(CAllpassPage)
//) }AFX_DATA_INIT }
CAllpassPage: : -CAllpassPage
{
} void CAllpassPage : : DoDataExchange (CDataExchange* pDX)
{
CPropertyPage : : DoDataExchange (pDX) ;
//{ {AFX_DATA_MAP (CAllpassPage)
DDX_Control (pDX, IDC_CHECK1 , m_BypassButton) ;
DDX_Control (pDX, IDC_SLIDER3 , m_QSlider) ;
DDX_Control (pDX, IDC_SLIDER1 , m_FrequencySlider) ;
/ I } } AFX_DATA_MAP }
BEGIN_MESSAGE_MAP (CAllpassPage, CPropertyPage)
//{ {AFX_MSG_MAP (CAllpassPage)
ON_BN_CLICKED (IDC_CHECKl , OnBypass)
ON_WM_VSCROLL ( )
ON_WM_PAINT ( )
//))AFX_MSG_MAP END_MESSAGE_MAP ()
III 'I III I II 'III 'UI II CAllpassPage message handlers void CAllpassPage: : OnBypass ()
{
// TODO: Add your control notification handler code here int state = m_BypassButton.GetState () & 0x3; g_DΞPManager- SetBypassSection( state, BypassAllpass) ;
BOOL CAllpasεPage: .OnlnitDialo ()
{
CPropertyPage: -OnlnitDialog 0 ,-
// TODO: Add extra initialization here rn_FrequencySlider .SetRange (0, CONTROL_RAKGE) ; m_FrequencySlider SetPos (CONTROL_RANGE-g_DSPManager- ^GetPara Value (kAllpassFreq) ) m_FrequencySlιder SetTιcFreq( (CONTROL_RANGE+l) /16) , m_QSlider . SetRange ( 0 , CONTROL_RANGE) ; m_QSlider SetPos (CONTROL_RANGE-g_DSPManager- >Ge ParamValue (kAllpassQ) ) ; m_QSlider SetTicFreq ( (CONTROL_RANGE+l) /16) , m_ParentWindow = (CTabDialog *) GetParent ( ) ->GetParent ( ) ; return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CAllpassPage : :0nVScroll (UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: Add your message handler code here and/or call default CSliderCtrl *slider = (CSliderCtrl * JpScrollBar ; int which;
CPropertyPage: :OnVScroll (nSBCode, nPos, pScrollBar);
Sleep(SO) ; if( slider == &m_FrequencySlider ) which = kAllpassFreq; else if( slider == &m_QSlider ) which = kAllpassQ; else return; g_DSPManager->SetParamValue (CONTROL_RANGE-slider->GetPos () .which) ; SendStringToUI (which) ,-
void CAllpassPage: : SendStringToUI (int which) {
CString str; g_DSPManager->GetStringValue (which, str) ; m_ParentWindow->SetStatusString (0, str) ;
void CAllpassPage: :OnPaint () {
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here m_FrequencySlider. SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kAllpassFreq) ) , m_QSlider.SetPos(CONTROL_RANGE-g_DSPManager->GetParamValue (kAllpassQ) ) ; I"_ByPassButton.SetCheck(g_DSPManager->GetBypassSec ion(kBypassAllpass) ) ;
// Do not call CPropertyPage: :OnPain O for painting messages }
// DSPComm.h: interface for the DSPConsn class. //
ffif !defined(AFX_DSPCOMM_H 33F9EF05_FSEF_1 lD2_96EE_00β097CDB9E2 INCLUDED_)
((define AFX_DSPCOMM_H 33F9EFO5_F6EF_llD2_96EE_O06097CDB9E2 INCLUDED_
((if _MSC_VER >= 1000
((pragma once
(fendif // _MSC_VER >= 1000 class DSPComm
{ public : virtual BOOL IsTransmitting () ; virtual long GetDetectState (void) ; virtual BOOL CheckState (void) ,- virtual long SendDSPMemory (char *, long) ; virtual long SendDSPWord (long) ;
DSPComm () ; virtual -DSPComm O ;
) •- ff endif // ! def ined (AFX_DSPCOMM_H__33F9EF0S_F6EF_HD2_96EE_00e097CDB9E2 INCLUDED_)
Figure imgf000063_0001
()Buτ3qτujsuEJ:j,sι .umioodsα ^OOa
•' ( TO Juanqsa
()aqεqs3θa33α3aθ: -uiωoodsα Buoχ
- ( aruq ) umqai ()aqEqs5(Oaqo: :ιmιιθDdSα lOOH
•' ( 10 ) ucnqaj;
(U3χ 6uoχ Ε Ep, -CEUpjAlouiawdSαpuaS- -ωuioodSα Buoχ
Figure imgf000063_0002
(Buoχ)pαθMdSαpuas: : ωιoθdSα Buoχ
{
) OuiioodSα-' :ιuuιoθdSα
{
) ( ) uiuiood Sα • uωiood Sα ιιιιιιιιιιιιιιιιιιιιιιιιιιιιιιιιιιιιιιιιιιt uιoιιtιqoιιnιjιqιsιaαιι/uιoιιτιqoιnιαιιqιsuιoιDιιι /
////////////// I 111 III II jτpusf)
H3N~0na3α «3u auτjapfj
' 3113 = [)31Id_SIHX JEU.O oτqεqs
3Tia_SIHX japunft onaaα" gapjrj/ uM unuoodSα.. 3pnχouτ()
„q εs„ apnχouτff
„L( xjεpas. apnχ_)uτf) lUiuuuuuuiiiiJiuiil/iliiitliiiiiiiliiiiiiiiiii mi Illinium
II ssep umiooasα au.q jo uoτqεquaιuaχdιιιτ ddo ωuioo sα //
Z9
8Ϊ6II/I0 OΛV I6IZ/00Sfl/13d // DSP56kManager h interface for the CDSPSβkManager class // uiuumiumuumimuiiiumuuiiiiiiiiiiiuiuuuuuuui
If if ' def ined (AFX_DSP56 KMANAGER_H 0CF7E204_D 90_11D2_96EE_006097CDB9E2 INCLUDED_)
((de f ine AFX_DSPS6KMANAGER_H OCF7E204_D790_11D7_9SEE_006097CDB9E2 INCLUDED_
Figure imgf000064_0001
= 1000
(( include " DΞPSSEquates h ' ((include DSPComm h "
((de f ine CONTROL_RANGE_L2 12
((de f ine CONTROL_RANGE ( ( lL< <CONTROL_RANGE_L2 ) 1 )
((def ine PG_CONTROL_AMT (CONTROL_RANGE/64 )
((de f ine CONTROL_RANGE_SC ( 23 -CONTROL_RANGE_L2 )
((def ine DS P_CONTROL_MAX 8388608 class CDSP56kManager { long m_DSPReturn, long m_Raw2DSPVals [kUIArraySize] , long m_RawVals (kUIArraySizel , long m_DSPVals [kDSPArraySizeJ , double m_pι ,
DSPComm *m_Comm public void GetPureStrmgValue (int which, CStrmg &str) , void GetFιlterBlob (CStrιngArray tarray) , virtual BOOL GetBypassSectιon (ιnt which) , virtual void SetBypassSectιon (BOOL value , int which) , virtual BOOL IsBusy O , virtual void GetStnngValue l int which, CString &str) , virtual BOOL IsReady (void) , virtual void SetAnaloglnput (long) , virtual int GetHDCDMode (void) , virtual void ResetAll (void) , virtual void SetHDCDGamScale ( long) , virtual void SetHDCDBypass (long) , virtual void SetDDXCo pBypass ( long) , virtual void SetBypass ( long value) , virtual void GetDSPSettings (CStπngArray &array) , virtual void SetDSPSettings (CStringArray tarray) , virtual void Se Par amValue ( long value , long which) , virtual long Get ParamValue ( long which) void DownlσadDΞPCode (voιd) ,
CDSP56kManager (HWND p) , virtual -CDSP56kJ anager 0 , private void SetNotchQdong value, long which, long freqwhich) , void SetNotchFreq (long value, long which), void SetShelvFreq (long value, long which), void SetBoostCut (long value long which) void SetRawValue ( long value long which), double DoConvertFreqRange (double in double top double bottom), double ConvertFreqRange (int which) double ConvertQRange (long val) , double ConvertBoostCutRange (long val) virtual void SendDSPValue (long which) mt CheckεumSREC (char *lmeptr int N) void GetSRecordAddressRangefchar *ε long 'start long *end char **data) protected virtual void SetDelay ( long value) void SetLoCutof f (void) 64 void SetHiCutoff (void) void SetHiCutoff2 (void) virtual void SetHiCutof f2Q (long value) virtual void SetHiCutof f2Freq (long value) virtual void SetHiCutof fQtlong value), virtual void SetHiCutof Freq (long value) virtual void SetLoCutoffQtlong value) virtual void SetLoCutof fFreq (long value) virtual void SetPreVolume (long value) virtual void SetAnalogVolume (long value)
// virtual void SetCutofflFreq ( long value) // virtual void SetCuto lQ(long value) // virtual void SetCutofflBooεt (long value) // virtual void SetCutof f2Freq (long value), // virtual void SetCutoff2Q(long value) , // virtual void SetCutoff2Booεt (long value) virtual void SetΞhelvlFreq (long value), virtual void SetShelvlBoos (long value), virtual void ΞetShelv2Freq(long value) . virtual void SetShelv2Boost (long value), virtual void SetNotchlCu (long value), virtual void SetNotchlQ(long value) , virtual void SetNotchlFreq(long value), virtual void SetNotch2Cu (long value), virtual void SetNotch2Q(long value) , virtual void SetNotch2Freq(long value), virtual void SetNotch3Cu (long value), virtual void SetNotch3Q(long value) , virtual void ΞetNotch3Freq(long value) , virtual void SetNotch4Cut (long value) virtual void SetNotch4Q(long value) , virtual void ΞetNotch4Freq(long value) , virtual void SetNotch5Q(long value) , virtual void SetNotchSBooεt (long value), virtual void SetNotchβCu (long value), virtual void SetNotchδQ(long value), virtual void SetNotchβFreqdong value) , virtual void SetNotch7Cut (long value), virtual void SetNotch7Q(long value) , virtual void SetNotch7Freq(long value) , virtual void SetNotch9Freq(long value) , virtual void SetMainVolume (long value).
}. extern CDSPSSkManager *g_DSPManager, ffendif // ' def ined (AFX_DSP56KMANAGER t OCF7E204_D790_11D2_96EE_006097CDB9E2 INCLUDED_)
// DSP56kManager cpp implementation of the CDSP56kManager class // i ui iii/iiiπi m t mi i nun i ni i ii ii inn ii ii 1111 mi i ii ii iπ/i ii 111
((include "stdafx h' #ιnclude "sa ' #include "DSP56kManager h" ((include <math h> ((include <stdlιb h> #ιnclude <stnng h>
#ι£ 0
#include "unιt_ppι h"
#ιnclude "functs h" ffendif
#ιfdef SPI
#ιnclude "SPIPEMicroCorπn h"
#endιf
((include "I2CIPortComm h"
#include "Ξapmem h" #mclude "SΞTParams h"
#ιfdef . _DEBUG
#undef THIS_FILE static char THIS_FILE[]= FILE
#defme new DEBUG_NEW
#endιf
#ιf 0 static int cmd_delay = 1000; static mt ιo_delay = 50; ffendif
((define FI E_VERgiON 2 // file version
#defιne GAIN_SCALE 8
// volume
#define VOLTOP 1.
#define VOLBOT 3.909e 6
((define VOLRANGE (V0LTOP-V0LBOT)
// hi and lo cutoff and shelving ranges ((define FLCTOPRANGE 0 149 // 1000/22050 #defιne FLCBOTRANGE 0 001769 // 10/22050
((define FLCRANGE (FLCTΌFRANGE-FLCBOTRANGE)
((define FHCTOPRANGE 1 // 22050/22050
((define FHCBOTRANGE 0 63 // 8000/22050
((define FHCB0TRANGE2 0 42 // 4000/22050
Ddβfine FHCRANGE (FHCTOPRANGE-FHCBOTRANGE)
#define FHCRANGE2 (FHCTOPRANGE-FHCBOTRANGE2)
((define QLCTOPRANGE 1 0 // 1
((define QLCBOTRANGE 0 003891 // 0 001
#defme QLCRANGE (QLCTOPRANGE- (QLCBOTRANGE) I ffdef ine SAMP ING_FREQ 44100 #de ine DELAY LENGTH 128
// converts frequency range to log scale tidefine FTOPRANGE 1
((define FBOTRANGE 0 134
((define FRANGE (FTOPRANGE-FBOTRANGE)
(tdefine FTOPRANGE2 0 585 // about 2205 top
((define FBOTRANGE2 3 531E-3 1
66
// new ranges using actual frequencies ((define FTOPRANGE3 4 431 // 3000 Hz ((define FBOTRANGE3 2 433 // 30 Hz
// hi cutoff filter ranges
((define QHC2BOT 0 74
((define QHC2TOP 2 258
((define FHC2BOT 3 954 // 1000 Hz
((define FHC2TOP 5 255 // 20 kHz
((define FHCTOPRANGE3 5 13 // 15000
((define FHCBOTRANGE3 FHC2BOT
static char *m_ParamNames [kUIArraySize] = ( "MainVolume" , "LoShelfFreq" , "LoShelfGain" , "HiShelfFreq", "HiShelfGam", "NotchlFreq", "NotchlQ", "NotchlCut", "Notch2Freq", "Notch2Q", "Notch2Cut", "Notch3Freq", "Notch3Q", "Notch3Cut", "Notch4Freq", "Notch4Q", "Notch4Cut", "Notch5Freq", "NotchSQ", "Notch5Cut", "PreVolume" , "Bypass", "LoCutoffFreq", "LoCutoffQ", "HiCutoffFreq", "HiCutoffQ", "HDCDBypass", "HDCDGamScaleOff" , "DDXCompBypass " , "Notch6Freq", "Notch6Q", "Notch6Cut", "Notch7Freq1", "No chTQ", "Notch7Cut',, "Analogln", "AnalogVolume" , "Delay", "AllpassFreq" , "AllpasεQ", "BypaεεMask" , "HιCutoff2Freq", "HιCutoff2Q", "NotchβFreq", "NotchSQ", "NotchβCut", "No ch9Freq", "Notch9Q" "Notch9Cut". "NotchAFreq". "NotchAQ", "NotchACut " , "DBNotchWidth" ) uuiiuumuumuuiiumuimuiuuiuiuuiuniiiiiiiiiuu
II SREC code int CDSPSGkManager ChecksumSREC (char •hneptr.iπt N) { unsigned char curbyte, sum=Ox f , for (int x=2,x N-2,x+=2) sscanf ( 1 inep r+x, "%2x" , Scurbyte) , sum- =curbyte.
// last one is checksum sεcanf (1 ineptr+x, "%2x" , kcurbyte) , return (curbyte==sum) ,
void CDSP56kManager GetSRecordAddressRange (char *ε, long 'start, long *end, char **data) { long address, coun , sof se ;
*εtart = -1L; *end = -1L; lf (*s '= 'S*) // not a srec return;
// Let's check the checksum for this line ASSERT ( CheckεumSREC(s,strlen(s) ) ), switch! s[l] )
{ case '1 ' : so fset=8; εscanf (&(s [4] ) , "%4x", taddress) ; break ; caεe '2 ' : sof set=10; sscanf (&(s [4) ) , "%6x", taddress) ; brea ; case '3 ' : εσf εet=12; sscanf (£(s (4] ) , "%8x", Saddress) ,- break; default- return; break;
) count = strlen(s) - soffset - 2,
•start = address;
•end = address + (count/6) ; // each word is 6 characters
*data = s + soffset.
void CDSP56kManager DownloadDSPCode 0 ( char **r = pmem, int count = PRECORDS, long start, end, long ts, e, char * *recs, char *srecdata, « td, char 'data, *dptr , *rdata, c, long size.bsize, long taddress , recstart , recend, long value. // get starting and ending addresses start = 0X7FFFFFFFL; end = 0; recs = r; for ( int i = 0; i < count ; i++ )
(
GetSRecordAddressRange (*recε+ + ,&ts,&te, £,srecdata) if( ts < 0L ) continue; start = min(start , ts) end = max (end, te) ;
size = end - start; bsize = size * 3 ; rdata = (char *) malloc (bsize+ G) ; // 3 bytes per word plus length and address
ASSERT ( data != NULL ) ; data = rdata + 6; dptr = data; for( i = 0 ; i < bsize ; i++ ) // clear memory
*dptr++ = 0; taddreεε = star ; while ( taddress < end )
{ recstart = 0X7FFFFFFFL; recs = r; for( int i = 0; i < count ; i++ ) // search for next address
{
GetSRecordAddressRange (*recs, tts, &te, ttd) ; if( ts >= 0L )
{ if( ts >= taddress )
{ if( ts < recstart )
{ recstart = ts; recend = te; εrecdata = td;
ASSERT( recεtart <= end ) ,-
// copy record dptr = data + ((recstart - εtart)*3); whilef recεtart != recend )
{ εscanf (srecdata, " %2x" , tvalue) ;
*dptr++ = (char ) value ; srecdata += 2 ; sscan (srecdata, "%2x" , lvalue) ;
*dptr++ = (char ) value ; srecdata += 2 ; εεcanf (srecdata , "%2x" , tvalue) ,-
*dρtr++ = (char ) value ; srecdata += 2 ; recstart++;
} taddreβs = recend;
}
// copy size and address dptr = rdata; c = (size > > 16) & OxFF;
*dptr++ = c; c = (size >> 8) & OxFF;
*dptr++ = c; c = size & OxFF;
*dptr++ = c;
C = (start >> 16) fc OxFF; *dptr++ = c c - (start > > 8) & OxFF
* ptr++ - c c s= start & OxFF
Figure imgf000070_0001
// send data Co DSP /m Tσmrn >SendDΞPNor (size) //m_Comra- >SendDSPWor (start ) m_Comm >SendDSPMemory {rdata bειze+6) free( rdata )
II Construction/Destruction ιιιιιιιιιιιιιuι//ιuιιιιiHiιιιιιιunnιιιι mini ui! nun iiuiiu
CDSPSGkManager CDSP56kMana9er (HVTND p) {
Figure imgf000070_0002
ι£( load_dll()==false )
(
MeεεageEox(UΛΛTj, "UNIT PPI not found in the system directory Fix this and restart application Will Robinson", MB_OK | MB_ICONSTOP ),
} else
Figure imgf000070_0003
ffendif m_pα - acos l - 1 ] m_Comm = new r2CIPortCom (p) ,
// DownloadDSPCode () , int l for ( ι = 0 l < kUIArraySi ze , ι++ )
{ m_Raw2DSPValε |l) = i,
) ra_Raw2DSPVals IkNotchSFreq) = kDSPNOtch6Freq ra_Raw2DSPValε (kNotchβQ) = kDSPNotch6Q, m_Raw2DSPVals (kNotchSCut) = kDSPNotchGCut m_Raw2DSPVals |kNotch7Freq] = kDSPNOtch7Freq m_Raw2DSPValε (kNotc 7Q) = DSPNotch7Q, m_Raw2DSPVals[kNotch7Cut] = kDSPNotch7Cut, m_Raw2DSPValE [kDelayl = kDSPDelay, n_Raw_DSPValB tkAllpissFreα] = kDSPAllpassFreq m_Ra 2DSPVπls [kAllpassQ] = kDSPAllpassQ m_Rav2DSPValβ[kNotc 8Freq) = kDSPNotchBFreq m_Raw2DSPValB[kNotch8Ql - kDSPNotchSQ. m_Rav2DSPVals (kNotchSCut) kDSPNotch3Cut m_Raw2DSPVals(kNotcti9Freg) = kDSPNotch9Freq m_Raw2DSPVals(kNotch9Q) - kDSPNotch9Q m_Rau2DSPVale(fcMotch9Cut) - kDSPNotc ?Cu , m_Ra 2DSPValE[kMotc AFreql = kDSPNotchAFreq m_Raw2DSPVals [kNotc AOl = kDSPNotchAQ m_Raw2DSPVals [)_NOtChACUt1 kDSPNotchACut
ResetAll ( 1 CDSPSGkManager - -CDSP56kManager ( ) { i f ( m_Comm ) delete Comπi,
void CDSP56kManager SetMainVolume (long value) { double fvalue, ιf( value >= 0 )
SetRawValue (value, kMamVolume) , ιf( m_RawVals [kMainVolume] == DSP_CONTROL_MAX ) m_DSPValε [kDSPMainVolume] = -m_RawValε [kMainVolume] , else ιf( m_RawVals (kMainVolume) == 0 ) m_DSPVals [kDSPMainVolume] = 0, else
{ fvalue = m_RawValε [kMainVolume] ; f alue /= DSP_CONTROL_MAX; // normalize fvalue *= VOLRANGE; fvalue += VOLBOT; fvalue = (pow (10., value) - 1. ) / (10. -1. ) ; fvalue *= DSP_CONTROL_MAX; m_DSPVals [kDSPMainVolume) = (long) -fvalue;
} SendDSPValue (kDSPMainVolume) ;
} void CDSP56kManager : : SendDSPValue (long which) { long value = m_DSPValε [which] ,-
#if 0
// transmitted value has parameter value in top 16 bits and parameter identifier in 8 LSBs value = (value 6 OxFFFFOO) | (which 6 OxFF) ; // m_DSPReturn = spi_xchng24 (value) ,- m_DSPReturn = m_Comm->SendDSPWor (value) ; ffendif
// changed protocol around to send index followed by data char buffer [6] • buffer [0] = (which >> 16) & OxFF; buffer [1] = (which >> 8) & OxFF; buffer [2] = which & OxFF; buffer[3] = (value >> 16) & OxFF; buffer [4] = (value >> 8) & OxFF; buffer [5] = value & OxFF; m_DSPReturn = m_Comm->SendDSPMemory (buffer, 6) ;
void CDSP56kManager : SetNotchFreq (long ivalue.long which)
double value; int dspmdex = m_Raw2DSPVals [which) if ( lvalue >= 0 )
SetRawValue (lvalue, which) , value = ConvertFreqRange (which) , value = - cos (m_pι*value) , value *= DSP_CONTROL_MAX, m_DSPVals [dspindex] = (long) value, SendDSPValue (dspindex) ; SetNotchQOlL, which+1, which) ;
}
K i fdef LEGACY void CDSP56kManager : : SetShelvFre ( long ivalue . long which)
{ double value, wc; int dspindex = m_Raw2DSPVals [which] ; if( ivalue >= 0 )
SetRawValue ( ivalue, which) ; value = ConvertFreqRange (which) ; wc = m_pi*value; value = (tan(wc/2) -1)/ (tan(wc/2) +1) ; value *= DSP_CONTROL_MAX; m_DSPVals [dspindex] = (long) value; SendDSPValue (dspindex) ;
} ffendif void CDSP56kManager: : SetNotchQdong ivalue.long which, long rawfreq) { double beta, tbeta, , c; int dspindex = m_Raw2DSPVals [which) ; if( ivalue >= 0 )
SetRawValue (ivalue, hich) ; wc = ConvertFreqRange (rawfreq) ; wc = m_pi*wc; q = ConvertQRange (m_RawVals [which] ) ; tbeta = wc/ (2*q) ; if ( tbeta > m_pi/4 ) tbeta = m_pi/ beta = (l.-tan(tbeta) )/(l.+tan(tbeta) ) ; beta *= DSP_CONTROL_MAX; m_DΞPVals (dspindex] = (long) beta; SendDSPValue (dspindex) ,-
void CDSP56kManager: :SetBoostCu (long ivalue, long which) { double value; int dspindex = m_Raw2DSPValε [which] ,- if( ivalue >= 0 )
SetRawValue ( ivalue, which) ,- value = ConvertBoostCutRange (m_RawVals [which] ) ,- value = pow(l0. . value) ; value /= GAIN_SCALE; value * = DSP_CONTROL_MAX ; m_DSPVals [dspindex] = ( long) value ; SendDSPValue (dspindex) ;
void CDSPS GkManager : : SetShelvlFreq dong ivalue)
// SetShe lvFreq lva lue , LoShelf Freq) ; double value , wc ; i f ( iva lue > = 0 )
SetRawValue (ivalue, kLoShelfFreq) ; value = m RawVals (kLoShelfFreq] ,- value /= DSP CONTROL MAX; // normalize value *= FLCRAGE, value += FLCBOTRANGE, value = (pow(10 .value) - 1 )/(10 -1 ), wc = m_pι*value, value = (tan(wc/2) - 1) / ( tan (wc/2) +1) , value *= DSP_CONTROL_MAX, m_DSPVals [kLoShelfFreq] = (long) value,
SendDSPValue (kLoShelfFreq) ,
void CDSP56kManager SetShelvlBoost (long value)
SetBoostCut (value, kLoShelfGain)
void CDSP56kManager SetShelv2Freq(long lvalue) {
// SetShelvFreqfvalue, kHiShelfFreq) ; double value, wc, ιf( ivalue >= 0 )
SetRawValue (lvalue, kHiShelfFreq) ; value = ra_RawVals [kHiShelfFreq] ; value /= DSP_CONTROL_MAX; // normalize value *= FHCRANGE2; value += FHCBOTRANGE2 , value = (pow(10 , value) - 1 )/(10.-l.),- wc = m_pi*value; value = (tan(wc/2) -1) / (tan(wc/2) +1) ; value *= DSP_CONTROL_MAX; m_DSPVals [kHiShelfFreq] = (long) value; SendDSPValue (kHiShel Freq) ,
void CDSP56kManager: SetShelv2Boost (long value) {
SetBoostCu (value, kHiShel Gain) ;
) void CDSP5SkManager : . SetNotchlFreq f long value) {
SetNotchFreq (value , kNotchlFreq) ;
} void CDSP56kManager • - SetNotchlQ f long value) {
SetNotchQ (value , kNotchlQ, NotchlFreq) ;
} void CDSP56kManager SetNotchlCut ( long value) {
SetBoostCu (value , NotchlCut ) ,
} void CDSPSGkManager SetNotch2Freq ( long value) {
SetNotchFreq (value , kNotch2Freq) , 73
void CDSP56kManager : :SetNotch2Q(long value) {
SetNotchQ(value, Notch2Q, Notch2Freq) ;
void CDSP56kManager : :SetNotch2Cut (long value) {
SetBoostCu (value, kNotch2Cut)
void CDSPSGkManager .- ,-SetNotch9Freq (long value) { double q, f , nf ;
SetNotchFreq (value, kNotch9Freq) ; f = ConvertFreqRange ()Notch9Freq) ; q = ConvertQRange (m_RawValε [kNotch9Q] ) ,- nf = f - (f / <5.*q)); if( nf < 0. ) nf = 0. ; nf = powlnf , 0.5); nf = logl0((nf * (10. -1.)) + 1. ) ; nf -= FBOTRANGE; nf /= (FTOPRANGE-FBOTRANGE) ; nf *= DSP_CONTROL_MA ; // normalize m_RawVals [kNotchβFreq] = (long) nf; nf = f + (f / (5-*q)); if( nf > 1. ) nf = 1. ; nf = pow(n , 0.5) ,- nf = logl0((nf * (10. -1.)) + 1. ) ; nf -= FBOTRANGE,- nf /= (FTOPRANGE-FBOTRANGE) ; nf *= DSP_CONTROL_MAX; // normalize m_RawVals [kNotchAFreq] = (long) nf; SetNotchFreq (-1L, kNotchβFreq) ; SetNotchFreq (-1L, kNotchAFreq) ,-
void CDSP56kManager : : SetNotch3Freq (long value) {
SetNotchFreq (value, kNotch3Freq) ; m_RawVals [κNotch5Freq] = (m_RawVals [kNotch4Freq] + m_RawVals [)cNotch3Freq] ) /2 ;
SetNotchFreq (-lL,kNotch5Freq) ;
void CDSP56kManager: :SetNotch3Q(long value) {
SetNotchQ(value, kNotch3Q, kNotch3Freq) ;
void CDSP56kManager : :SetNotch3Cut (long value)
SetBoostCut (value, Notch3Cut) , void CDSP56kManager SetNo ch Freq ( long value)
{
Se No chFreq (value, kNotch4 req) , m awvals (kNotch5Freq! = (m__RawVals IkNotchflFreq) + _Ra Vals [kNoCch3FreqH /2 ;
SetNotchFreq ( - lL, NotchSFreq) ,
void CDSP56kManager SetNotch4Q ( long value)
(
SetNotchQ (value, WJotchlQ kHotch4Fιeq) .
vo d CDSP56kManager- • SetNotch<)Cut (long value)
SetBoostCu (value, kNotch4Cut) ,
void CDSP56kManager: :SetNotch5Q (long value)
I
SetNotchQ (value. kNotehSQ UlotchSFreq] ;
} void CDSPSGkManager : :ΞetMotc 5Boos (long value)
(
SetBoostCut (value,kNotchSCut) ; ) double CDSPSβkManager: :DoConvertPreqRange (double val, double top, double bottom) { val /= DSP_CONTRO_MAX; // normalize val * - top - bottom; val += bottom; val = (powdO. ,val) - 1. ) / 110.-1. ) , return! val ) ,-
double CDSP56kManager: : ConvertFreqRange (int which) { double fval ; switch ( which )
{ case kNotchlFreq: case kNotch2Freq- fval = DoConvertFreqRange(m_RawValslwhιch] , FTOPRANGE3 , FB0TRAHGE3) , // top frequency is 0.1 * Nyquiε t fval /- SAMPLING_FREQ/2, break, default - fval = DoCoπvertFreqRange (m_RawVals (which] .FTOPRANGE. FBOTRAUGE) ;
// square log scale fval = fval « fval, break,
] return ( fvαl ) , // converts Q range to log scale
((define QTOPRANGE 2 258
((define QBOTRANGE 0 037
((define QRANGE (QTOPRANGE-QBOTRANGE) double CDSP56kManager ConvertQRange ( long ival)
double val, val = ival, val /= DSP_CONTROL_MAX, // normalize val *= QRANGE, val += QBOTRANGE, val = (pow(10 ,val) - 1 )/(10 -1 ), return ( val ) ,
// converts input value to log gain value
//((define LOG8 0.9031
((define LOGGAINSCALE (loglO (GAIN_SCALE) ) double CDSP56kManager: :ConvertBooεtCutRange (long ival)
{ double val ; val = ival; val /= DSP_CONTROL_MAX; // normalize val = (2.*val*LOGGAINSCALE) - LOGGAINSCALE; return( val ) ;
void CDSP5GkManager: : SetRawValue (long value , long which)
if ( value ) value += 1 ; value <<= CONTR0L_RANGE_SC; m RawVals [which] = value;
long CDSP56kManager: :GetParamValue (long which) { long value ; if( which >= kUIArraySize ) value = Ox400000L » CONTROL_RANGE_SC, else value = m_RawVals [which] >> CONTROL_RANGE_SC; value- - , ιf( value < 0 ) value = 0; returnt value ),
) void CDSP56kManager SetParamValue (long value, long which) ( switch! which )
{ case kHiCutoff2Freq
SetHiCutoff2Freq (value) , break, case kHιCutoff2Q
SetHiCutof 2Q(value) , break, case kHiCutof fFreq SetHiCutoffFreq(value) ; break; case kHiCutoffQ:
SetHiCutoffQ(value) ; break; case kLoCutoffFreq .-
SetLσCutoffFreq(value) ; break; case kLoCutoffQ:
SetLoCutoffQ(value) ; break; case kBypass:
SetBypass (value) ; break; case kDDXCompBypass :
SetDDXCompBypass (value) ; break; case kHDCDBypasε:
SetHDCDBypass (value) ; break; caεe kHDCDGainScaleO :
SetHDCDGainScale (value) ; break ,- case kAnalogVolume:
SetAnalogVolume (value) ,- break; case kMainVolume:
SetMainVolu e (value) ; break,- case kPreVolume:
SetPreVolume (value) ; break,- case kLoShelfFreq:
SetShelvlFreq (value) ; break; case kHiShelfFreq:
SetShelv2Freq(value) ; break; case kNotchβCut:
SetBoostCut (value, which) ;
SetBoostCut (value, kUotchACut) ,- // same value for both notches break; case kNotchlCut: case JcNotch2Cut : caεe kNotch3Cut: case kNotch4Cut: case kNotchSCu : case kNotchδCut: case kNotch7Cut-. case kLoShelfGain: case kHiShelfGain:
SetBoostCu (value, hich) ; break; caεe kNotch9Cut: m_DSPVals[kDSPNotch9Cut) = 0; // fixed notch
SendDSPValue (kDSPNotch9Cut) ; break; case kNotch3Freq:
SetNotch3Fre (value) ; break; case kNotch4Freq:
SetNotch4Freq (value) ; brea ; case kNotch9Freq:
SetNotch9Freq (value) ; break; case kNotchlFreq: case kNotch2Freq: caεe kNotch5Freq: caεe kNotch6Freq: case kNotch7Freq: case kAllpassFreq: Se otchFreq (value. hich) break, case kNotch8Q
SetNotchQ(value which, hich- 1)
SetNotchQfvalue kNotchAQ kNotchAQ 1) , // same value for both notches break, case kNotch9Q
SetNotchQ(value which whιch-1),
SetNotch9Freq( 1) brea , case kNotchlQ case kNotch2Q case kNotch3Q case kNotch4Q case kNotchSQ case kNotch6Q caεe kNotch7Q case kAllpassQ
SetNotchQ (value, hich, whιch-1) , break, case kDelay
SetDelay (value) , break ,- // case kDBNotchWidth // SetDela (value) , break; case kNotchβFreq case kNotchAFreq caεe kNotchACut case kNotchAQ break, }
void CDSP56kManager SetDSPSettmgs (CΞtringArray & array) { int l ,
CString string, int index; long value, int fileversion = 0, int 3 = 0; double fvalue, const char *εptr,
// reset all parameters ResetAll ,
// first check for comment at head string = array GetAt(O), sptr = string, ιf( strcmptεptr, "# VERSION") == 0 )
{ string = array GetAtd), sptr = string, sscanf (εptr, "%d" , &fι leversion) ,
3 = 2. ) for ( I = 3 , I < array GetSizeO , ι++ )
{ string = array GetAt(ι), εptr = string, ιf( εptr[0) == f( ' ) continue, // skip comments sscanf (sptr, "%d\t0x%x", s.index, &value) , ιf( index >= kUIArraySize ) continue,
// Add any special treatment of parameters here ιf( fileversion == 0L )
{ switch! index ) case kNotchlFreq case k otch2Freq fvalue = DoConvertFreqRange (value. FTOPRANGE. FBOTRANGE) , fvalue = fvalue * fvalue, fvalue *= SAMPLING_FREQ/2, fvalue = loglO ( (fvalue * (10 -1 )) + 1 ), fvalue -= FBOTRANGE3, fvalue /= (FTOPRANGC3 FBOTRANGE3 ) , ιf( fvalue > l 0 ) fvalue = 1 0, fvalue *= DSP_CONTROL_MAX, // normalize value = (long) fvalue, break,
// increased low frequency case kHiShelfFreq fvalue = DoConvertFreqRange (value, FHCTOPRANGE, FHCBOTRANGE) , fvalue = logl0( (fvalue * (10 -1 )) + 1 ), fvalue -= FHCB0TRANGE2 , fvalue /= (FHCTOPRANGE- FHCBOTRANGE2 ) , if( fvalue > 1 0 ) fvalue = 1 0, fvalue *= DSP_CONTROL_MAX, // normalize value = (long) fvalue, break, case kHiCuto Freq fvalue = DoConvertFreqRange (value, FHCTOPRANGE, FHCBOTRANGE) , fvalue *= SAMPLING_FREQ/2 , fvalue = logl0( (fvalue * (10 -1.)) + 1.), fvalue -= FHCBOTRANGE3 , fvalue /= (FHCTOPRANGE3-FHCBOTRANGE3) , rf( fvalue > 1 0 ) fvalue = 1 0, fvalue *= DSP_CONTROL_MAX, // normalize value = (long) fvalue, break, } } else if( fileversion == 1L )
{ switch! index )
{ case kNotchlFreq caεe kNotch2Freq fvalue = DoConvertFreqRange (value, FTOPRANGE2, FBOTRANGE2) ; fvalue *= SAMPLING_FREQ/2 , fvalue = logl0( (fvalue * (10 -1.)) + 1 ) ; fvalue -= FBOTRANGE3; fvalue /= (FTOPRANGE3-FBOTRANGE3) ; if ( fvalue > 1 0 ) fvalue = 1 0, fvalue *= DSP_CONTROL_MAX, // normalize value = (long) fvalue, break, case kLoCutoffFreq fvalue = DoConvertFreqRange (value, FLCTOPRANGE, FLCBOTRANGE) fvalue *= SAMPLING_FREQ/2, fvalue = logl0( (fvalue * (10 -1 )) + 1 ), fvalue -= FLCB0TRANGE2 , fvalue /= (FLCTOPRANGE2-FLCBOTRANGE2) , ιf( fvalue > 1 0 ) fvalue = 1 0, fvalue *= DSP_CONTROL_MAX, // normalize value = (long) fvalue, break, case kHiCutof 2Freq fvalue = DoConvertFreqRange (value, FTOPRANGE, FBOTRANGE) , fvalue *= SAMPLING_FREQ/2, fvalue = loglOf (fvalue * (10 -1 )) + 1 ), fvalue -= FHC2BOT, fvalue /= (FHC2TOP FHC2BOT) , if I fvalue > 1 0 ) fvalue = 1.0; fvalue *= DSP CONTROL_MAX ,- // normalize value = (long) fvalue; break; case kHiCutof Freq: fvalue = DoConvertFreqRange (value, FHCTOPRANGE, FHCBOTRANGE2) ; fvalue «= SAMPLING_FREQ/2; fvalue = logl0( (fvalue * (10. -1.)) + 1. ) ; fvalue -= FHCBOTRANGE3 ; fvalue /= (FHCTOPRANGE3-FHCBOTRANGE3) ; if( fvalue > 1.0 ) fvalue = 1.0; fvalue *= DSP_CONTROL_MAX; // normalize value = (long) fvalue; break; } } m_RawVals [index] = value;
) // tell DSP of changes for( i = 0 ; i < kUIArraySize ; i++ )
{
SetParamValue (-l,i) ; •
} m_DSPVals [kDSPBypassMask] = m_RawValε [kBypassMask] ; SendDSPValue (kDSPBypassMask) ,-
void CDSP56kManager: :GetDSPSettings (CStringArray £ array) { char s[1000] ; int i, ndex; int j = 0; CΞtring cstr;
// write header (εo far only verεion number) cstr = "# VERSION" ; array. SetAtGrow(j++, cstr) ; sprintf (s, "%d" , FILE_VERSION) ; array. SetAtGrow(j++, s) ; cstr = "# DATA"; array. SetAtGrow(j++, cstr) ,- for( i = 0 ,- i < kUIArraySize ; i++ )
{ index = kUIArraySize-1-i; if ( index == kBypass ) continue; if ( index == kHDCDBypass ) continue; if ( index == kHDCDGainScaleOf ) continue; if ( index == kAnalogln ) continue;
// MM 7/14/99 Added value in human readable form as comment
GetStringValue (index, cstr) ,- sprint (ε, "S %ε is" ,m_ParamNames [index] , cstr) ; array. SetAtGrow(j++, s) ; sprintf (ε, "%d\t0x%x", index, m_RawVals [index] ) ,- array. SetAtGrow(j++, s) ■
void CDSP56kManager : :GetFilterBlob (CStringArray & array)
char ε [1000] ,- int param; int 3 = 0; CString cstr; float v;
// write version number // cstr = " (f VERSION " ,
// array SetAtGrow(3++. cstr). sprint (s, "%d", BLOB_FILE_VERSION) , array SetAtGro ( 3 ++ , ε) ,
// output delay param = kDelay,
GetPureStringValue (param, cstr) , sscanf (cstr, "%f " , S,v) , ιf( v '= 0. )
{ // cstr = m_ParamNames [param] , // array SetAtGrow (3++, cstr), sprintf (ε, "%d" , BLOCK_DELAY) , array SetAtGrow (3 ++, s) , cstr = "1"; array . SetAtGrow(3 ++. cεtr);
GetPureStringValue (param. cstr) arra .SetAtGro (j++, cstr); )
// output pre-gain param = kPreVolume; // cstr = m_ParamNames [param] ; // array. SetAtGrow(j++, cstr) ; εprint (ε, "%d", BLOCK_GAIN) ; array. SetAtGrow (3++, s) ,- cstr = "1"; array. SetAtGrow (3++, cεtr) ;
GetPureStringValue (param, cstr) ,- array. SetAtGrow(j++, cstr) ;
// lo-shelf if( !GetBypassSection(kBypassLoshelf) )
{ // cstr = "Low-Shelf"; // array. SetAtGrow (j++, cstr) ; εprint (s, "%d",BLOCK_LS) array. SetAtGro (3++, s) ,- cstr = "2"; array. SetAtGrow!j++, cstr) ,-
Ge PureStringValue (kLoShelfFreq, cstr) ; array. SetAtGro (j++, cstr);
GetPureStringValue (kLoShelfGain, cstr) ; array. SetAtGrow(3++, cstr); }
// hi-shelf if( !GetBypassSection(kBypassHiShelf) )
{ // cstr = "High-Shelf"; // array. SetAtGrow (j++, cstr) ; εprintf (ε, "%d", BLOCK_HS) ; array. SetAtGrow!j++, s) ; cεtr = "2"; array.SetAtGrow(3++, cstr) ;
GetPureStringValue (kHiShel Freq, cstr) ; array. SetAtGrow (j++, cstr) ,-
GetPureStringValue (kHiShelfGain, cstr) ,- array SetAtGrow (j++, cstr) ; )
// low peaking cutoff ιf( iGetBypassSection (kBypassHipasε) )
{ // cεtr = "Low Cutoff", // array SetAtGrow (3++, cstr) • sprintf (s, "%d" , BLOCK_HP) , array SetAtGrow(3 ++, ε) , cetr = "2"; array SetAtGrow<3++, cstr),
GetPureStringValue (kLoCuto Freq, cstr) , array SetAtGrow (j ++ cstr), GetPureStringValue (kLoCutof Q cstr) array SetAtGrow(3 ++ cstr)
// high peaking cutoff #1 ιf( 'GetBypasεSectιon(kBypassLopass) )
{ // cstr = "High Cutoff", // array SetAtGrow (3++, cεtr), sprintf (s, "%d" BLOCK_LP) , array SetAtGrow (3 ++ s) cstr = "2" array SetAtGro (3 ++, cstr),
GetPureStringValue (kHiCuto fFreq, cstr) array SetAtGrow ( ++, cstr),
GetPureStringValue (kHiCuto fQ cstr) , array SetAtGrow(3++ , cstr) }
// high peaking cutoff #2 ιf( 'GetBypaεsSectιon(kBypassNLopass) )
{ // cstr = "High Cutoff #2", // array SetAtGrow (3++, cεtr) , sprintf (s, "%d" , BLOCK_LP2) , array SetAtGrow (3++, s) , cstr = "2", array SetAtGro (3++, cstr),
GetPureStringValue (kHiCutoff2Freq, cstr) , array SetAtGro (3++, cεtr) ,
GetPureStringValue (kHiCutoff2Q, cεtr) , array SetAtGrow (3++, cεtr), )
// resonance comp #1 ιf( 'GetBypasεSectionfkBypassNotchl) )
( // cstr = "Parametric EQ", // array SetAtGrow (3++, cεtr), εprintf (s, "%d" , BLOCK_PEQ) , array SetAtGrow<3++, ε) , cεtr = "3", array SetAtGrow<3++, cεtr) ,
GetPureStringValue (kNotchlFreq, cstr) , array SetAtGrow(3++, cεtr) ,
GetPureStringValue (kNotchlQ, cstr) ; array ΞetAtGrow(3++, cεtr),
GetPureStringValue (kNotchlCut, cstr) , array SetAtGrow(3++, cstr) , )
// resonance comp 82 ιf( 'GetBypassSectιon(kBypasεNotch2) )
{ // cstr = "Parametric EQ", // array SetAtGrow (3++, cstr) , sprintf (s, "%d", BLOCK_PEQ) , array SetAtGro (3++, ε) , cεtr = "3", array SetAtGrow(3 ++, cεtr),
GetPureStringValue (kNotch2Freq, cstr) , array SetAtGro (3 ++, cεtr),
GetPureStringValue (kNotch2Q, cεtr) , array SetAtGro (3 ++, cεtr),
GetPureStringValue (kNotch2Cut, cεtr) , array SetAtGrow (3 ++ cεtr)
// resonance comp (f3 if ( ' Ge BypassSectιon(kBypassNotch3) // cstr = "Parametric EQ" ;
// array. SetAtGro (j++, cstr) ; εprint (s, "%d", BLOCK_PEQ) ; array . SetAtGrow(j++, s) ; cεtr = "3" array . SetAtGro ( ++, cεtr); GetPureStringValue (kNotchβFreq, cstr) ,- array .SetAtGrow)j++, cstr); GetPureStringValue (kNotchGQ, cstr) ; array . SetAtGrow(j + + , cεtr); GetPureStringValue (kNotch6Cut , cstr) ; array .SetAtGrow (j++, cstr) ;
// resonance comp Ui if( IGetBypassSection (kBypassNotch4) )
( // cstr = "Parametric EQ" ; // array. SetAtGro (j ++, cstr) ; sprint (s, "%d", BLOCK_PEQ) ; array. SetAtGrow (j++, ε) ; cstr = "3"; array. SetAtGrow (j ++, cstr) ;
GetPureStringValue (kNotch7Freq, cstr) array. SetAtGrow (j ++ , cs r);
GetPureStringValue (kNotch7Q,cstr) ; array. SetAtGro (j++, cstr) ;
GetPureStringValue (kNotch7Cut, cstr) ; array. SetAtGro (j++, cstr) ;
// conecry if! IGetBypassSection (kBypassConecry) )
{ // cstr = "Parametric EQ" ; // array. SetAtGrow(j++ , cstr) ,- εprintf (ε, "%d",BLOCK_PEQ) ; array. SetAtGrow (j++, ε) ; cεtr = "3"; array. SetAtGro (j++, cεtr) ;
GetPureStringValue (kNotch3Freq, cεtr) ; array. SetAtGrow (j++, cstr) ;
GetPureStringValue (kNotchSQ, cεtr) ; array. SetAtGrow) ++, cstr) ;
GetPureStringValue (kNotch3Cut, cstr) ; array. SetAtGrow (j++, cstr) ;
// cstr = "Parametric EQ" ;
// array. SetAtGro (j++, cstr) ; εprintf (ε, "%d", BLOCK_PEQ) ; array. SetAtGrowt ++ , s) .- cstr = "3"; array. SetAtGrow(j++, cstr);
GetPureStringValue (kNotch4Freq, cstr) ; array.SetAtGrow (j ++, cstr) ;
GetPureStringValue (kNotch4Q, cstr) ; array. SetAtGrow (j ++ , cstr) ,-
GetPureStringValue (kNotch4Cut, cstr) ; array .SetAtGro (j++, cstr) ;
// cstr = "Parametric EQ",-
// array. SetAtGrow) j++, cstr) ; εprintf (s, "%d" , BLOCK_PEQ) ; array. SetAtGro (j++, s) ; cεtr = "3"; arra .SetAtGrow (j ++, cεtr) ;
GetPureStringValue (kNotch5Freq, cstr) ; array .SetAtGrow (j++, cstr);
GetPureStringValue (kNotchSQ, cstr) ; array .SetAtGrow! j ++, cstr);
GetPureStringValue (kNotchδCut, cstr) ; array .SetAtGrow (j ++ , cstr); // al lpass ι f ( ' GetBypassSec ion ( kBypassAl lpass ) )
{
// cstr = "Parametric EQ",
// array SetAtGro (3 ++, cstr), εprintf (s, " d" , BLOCK_AP) , array SetAtGro (q ++, s) ; cstr = "2", array SetAtGrow (3++, cstr) ;
GetPureStringValue (kAllpassFreq, cεtr) array SetAtGrow (3++, cstr) ;
GetPureStringValue (kAllpassQ, cstr) , array SetAtGrow ( j ++, cstr), )
// double-tuned notch if( IGetBypassSection (kBypasεDBNotch) )
{ // cεtr = "Parametric EQ"; // array. SetAtGrow (j++, cstr) , sprintf (s, "%d" , BLOCK_PEQ) ; array. SetAtGrow(j++, s) ; cstr = "3"; array. SetAtGrow (j++, cstr) ;
GetPureStringValue (kNotchβFreq, cεtr) ; array. SetAtGrow (j++, cεtr) ;
GetPureStringValue (kNotchβQ, cstr) ; array. SetAtGrow (3'++, cεtr) ,-
GetPureStringValue (kNotchβCut, cεtr) ; array. SetAtGro (j++, cεtr);
// cεtr = "Parametric EQ";
// array. SetAtGrow (j++, cstr) ; sprintf (s, "%d" , BLOCK_PEQ) ; array. SetAtGrow (j++ , s) ; cstr = "3"; array. SetAtGrow(j++, cstr) ,-
GetPureStringValue (kNotch9Freq, cstr) ; array. SetAtGrow (3++, cεtr) ,-
GetPureStringValue (kNotch9Q, cstr) ; array. SetAtGrow (j++, cεtr) ,-
GetPureStringValue (kNotch9Cut, cεtr) ; array. SetAtGrow (j++, cεtr);
// cεtr = "Parametric EQ";
// array. SetAtGrow (j++, cεtr) ; εprintf (s, "%d" , BLOCK_PEQ) ; array. SetAtGro (j ++, s) ; cstr = "3"; array. SetAtGrow!j ++, cstr) ;
GetPureStringValue (kNotchAFreq, cstr) ; array SetAtGrow (j++, cstr) ,-
GetPureStringValue (kNotchAQ, cstr) ; array. SetAtGrow (j++, cstr) ;
GetPureStringValue (kNotchACut, cstr) , array. SetAtGro (j++, cstr);
)
// output post-gam param = kMainVolume, // cstr = m_ParamNames [param] ,- // array SetAtGro (3 ++, cstr) ; εprintf (ε, "%d" , BLOCK_GAIN) ; array .SetAtGrow (3++, s) ; cstr = " 1 " ; array SetAtGrow (3++, cstr) ;
GetPureStringValue (param, cεtr) , array SetAtGrow(3 ++, cstr), void CDSP56kManager: : SetPreVolume (long value) ( double value,- if( value >= 0 )
SetRawValu (value, PreVolume) ; if( m_RawVals [kPreVolume] == DSP_CONTROL_MAX ) m_DSPValε [kDSPPreVolume] = -m RawVals [kPreVolume] else if( m_RawVals [kPreVolume] == 0 ) m_DSPVals [kDSPPreVolume] = 0 ; else
( fvalue = m_RawVals [kPreVolume] ; fvalue /= DSP_CONTROL_MAX; // normalize fvalue •= VOLRANGE; fvalue += VOLBOT; fvalue = (pow( 10..fvalue) - 1. ) / (10. -1. ) ,- fvalue *= DSP_C0NTR0L_MAX; m_DSPValε [kDSPPreVolume] = (long) -fvalue;
} SendDSPValue (kDSPPreVolume) ;
void CDSP56kManager: : SetAnalogVolume (long value) { double fvalue; i f ( value >= 0 )
SetRawValue (value , kAnalogVolume) ,- if ( m_RawValε [kAnalogVolume] == DSP_CONTROL_MAX ) m_DSPVals [kDSPAnalogVol] = -m_RawValε [kAnalogVolume] else if ( m_RawValε [kAnalogVolume] == 0 ) m_DSPValε [kDSPAnalogVol] = 0 ; else
{ fvalue = m_RawVals [kAnalogVolume] ; fvalue /= DSP_CONTROL_MA ; // normalize fvalue *= VOLRANGE; fvalue += VOLBOT; fvalue = (pow (10., fvalue) - 1. ) / (10. -1. ) ; fvalue *= DSP_CONTROL_MAX; πι_DSPVals[kDSPAnalogVol) = (long) -fvalue;
SendDSPValue (kDSPAnalogVol) ;
} void CDSP56kManager : : SetBypass ( long value) ( i f ( value >= 0 )
SetRawValue (value, kBypass) ; if ( m_RawVals [kBypass] ) m_DSPValε (kDSPBypassJ = 0x7FFFFF; elεe m_DSPVals [kDSPBypass] = 0 ; SendDSPValue (kDSPBypaεε) ;
void CDSP56kManager : r SetLoCutof f Freq ( long value) ( i f ( va lue >= 0 )
SetRawValue (value , LoCuto Freq) ; SetLoCutof f O ;
} void CDSPSGkManager: :SetLoCuto fQϋong value) { if( value = 0 )
SetRawValue (value, LoCutof fQ) ; SetLoCutof f 0 ;
} void CDSP56kManager: :SetHiCutof fFreqdong value)
i ( value >= 0 )
SetRawValue (value, kHiCuto Freq) SetHiCutoff () ;
void CDSP56kManager: :SetHiCutoffQ(long value) { if ( value >= 0 )
SetRawValue (value, kHiCutof fQ) ; SetHiCutof f () ;
} void CDSP56kManager: : SetHiCutof 2Freq (long value)
if! value >= 0 )
SetRawValue (value, kHiCutoff2Freq) SetHiCutof 2 () ;
void CDSP56kManager: : SetHiCutoff2Q(long value)
if! value >= 0 )
SetRawValue (value, HiCutof f2Q) ; SetHiCutof f 2() ;
void CDSP56kManager: :SetHiCutoff () { double f,q; double al,a2,b0; q = m_RawVals [kHiCutof fQ] ; q /= DSP_C0NTR0L_MAX; // normalize q *= QLCRANGE; q += QLCBOTRANGE ; q = (pow(10.,q) - 1. ) / (10. -1. ) ; if( q >= 1. ) q = 0.99999;
1*1 = m_RawVals (kHiCutof fFreq) ; f /= DS P_CONTROL_MA ; // normalize f *= FHCRANGE2; f += FHCB0TRANGE2; f = (pow(10..f) - 1.1/(10.-1. ) ; */ f = DoConvertFreqRange (m_RawValε [kHiCutof fFreq) , FHCTOPRANGE3, FHCBOTRANGE3) f /= SAMPLING_FREQ/2; f = 2. * sin( f * m_pi / 2.); a2 = 1. - f * q; if( a2 >= 2. ) a2 = 1.99999; else if( a2 <= -2. ) a2 = -1.99999; al = - (2. - f * q - f * f ) ; if ( al = 2. ) al = 1.99999; else if( al <= -2. ) al = -1.99999; bO = f * f / 2. ; if( bO >= 8. ) bO = 7.99999; else if( bO = -8. ) bO = -7.99999; m_DSPValε[kDSPHiCutoffA2) = (long) (a2 * DSP_CONTROL_MAX/ 2. ) ;
SendDSPValue (kDSPHiCutoffA2 ) ; m_DΞPValε(kDSPHiCutoffAl) = (long) (al * DΞP_CONTROL_MAX/2. ) ;
SendDSPValue (kDSPHiCutoffAl) ; m_DSPVals [kDSPHiCutoffScale] = (long) (bO * DSP_CONTROL_MAX/ 16.)
SendDSPValue (kDSPHiCutoffScale) ;
} void CDSP56kManager: : SetHiCuto f2 ()
double f,q; double al,a2,b0; double gamma, beta, lambda, alpha ,- q = DSP_CONTROL_MAX - m_RawValε [kHiCutoff2Q] ; // invert scale q /= DSP_CONTROL_MA ; // normalize q *= (QHC2TOP-QHC2BOT) ; q += QHC2BOT; q = (pow(10.,q) - 1.1/(10.-1.); // f = ConvertFreqRange (kHiCutof 2Freq) ; f = DoConvertFreqRange (m_RawVals [kHiCuto f2Freq] , FHC2TOP, FHC2BOT) ; f /= SAMPLING_FREQ/2; gamma = - cos ( f * m_pi ) ,- beta = (1. - sin(f*m_pi/(2*q)))/(l. + εin(f*m_pi/ (2*q) ) ) ; if( beta > 2.0 ) beta = 2.0; lambda = 4. * beta * (gamma/ (1.+beta) ) ,- if( lambda > 2.0 ) lambda = 2.0; alpha = 1. + beta + lambda; a2 = beta; al = lambda ,- bO = alpha / 4. ; if( bO >= 8. ) bO = 7.99999; elεe if( bO <= -8. ) bO = -7.99999; m_DSPVals[kDSP2HiCutof fA2] = (long) (a2 * DSP_CONTROL_MAX/ 2. ) ;
SendDSPValue (kDSP2HiCutoffA2) ; m_DSPValε[kDSP2HiCutoffAl] = (long) (al * DSP_CONTROL_MAX/2. ) ;
SendDSPValue (kDSP2HiCutoffAl) ; m_DSPVals(kDSP2HiCutoffScale] = (long) (bO * DSP_CONTROL_MAX/ 16.),
SendDSPValue (kDSP2HiCuto fScale) ;
void CDSP56kManage : : SetLoCuto f 0 { double , q, εcale factor ; q = m_RawVals (kLoCutof fQ] , q /= DSP_CONTROL_MAX. // normalize q *= QLCRANGE, q += QLCBOTRANGE, q = (pow(10 ,q) - 1 ) /(10 -1 ) , if ( q = 1 ) q = 0 99999, f = m_RawValε [kLoCuto fFreq) , f /= DSP_CONTROL_MAX, // normalize f *= (FLCTOPRANGE2-FLCBOTRANGE2) , f += FLCBOTRANGE2 , f = (pow(10 , f) - 1 )/(10 -1 ) , f /= SAMPLING_FREQ/2, f = 2 * sιn( f * m_pι / 2 ) , ιf( f >= 1 ) f = 0 99999, scale_factor = ( . - 2 * f * q - f * ) /4 ; m_DSPValε[kDSPLoCutoffFc) = (long) (f * DSP_CONTROL_MAX) ;
SendDSPValue (kDSPLoCuto f Fc) ; m_DΞPVal [kDSPLoCutof fQc) = (long) (q * DSP_CONTROL_MAX) ;
SendDSPValue (kDSPLoCutof fQc) ; m_DSPValε [kDSPLoCuto Scale] = (long) (-0.5 * εcale_factor * DSP_CONTROL_MAX) ,
SendDSPValue (kDSPLoCutof f Scale) ;
void CDSP56kManager : :SetDDXCompBypass (long value)
if( value >= 0 )
SetRawValue (value, kDDXCompBypass) ; if( m_RawVals [kDDXCompBypaεε] ) m_DSPVals [kDSPDDXCompBypass] = 0X7FFFFF; elεe m_DSPValε [kDSPDDXCo pBypaεs] = 0; SendDSPValue (kDSPDDXCompBypass) ;
void CDSP56kManager: :SetHDCDBypass (long value) { ιf( value >= 0 )
SetRawValue (value, kHDCDBypasε) ; if( m_RawVals [kHDCDBypass] ) m_DSPVals [kDSPHDCDBypasε] = 0X7FFFFF; else m_DSPValε [kDSPHDCDBypaεs] = 0; SendDSPValue (kDSPHDCDBypasε) ;
} void CDSP56kManage : -SetHDCDGainScaledong value)
if( value >= 0 )
SetRawValue (value, kHDCDGamScaleOff) ; ιf( m_RawVals [kHDCDGamScaleOff] ) m_DSPValε [kDSPHDCDGamScaleOf f) = 0x7FFFFF; else m_DSPValε [kDSPHDCDGa ScaleOff] = 0, SendDSPValue (kDSPHDCDGamScaleOff) ,
void CDSP56kManager ResetAlK) { int i ; for ( i = 0 ,- i < kUIArraySize ,- i++ )
{ m_RawVals[i] = OX400000L;
) for( i = 0 ; i kDSPArraySize ; i++ )
{ m_DSPValε [ i ] = 0 ;
} m_RawValε [kAnalogVolume] = OxβOOOOOL; m_RawVals [kMainVolume] = 0x800000L; m_RawValε (kPreVolume) = OxβOOOOOL; m_RawVals [kBypass] = OxOOOOOOL; m_RawValε [kHDCDBypass] = OxOOOOOOL; m_RawVals [kDDXCompBypass] = OxOOOOOOL; m_RawValε[kHDCDGainScaleOf ) = OxOOOOOOL; m_RawValε [kAnalogln] = OxOOOOOOL; m_RawValε [kDelay] = OxOOOOOOL; m_RawValε [kHiCutoff2Freq] = OxGOOOOOL; m_RawVal [kHiCutoff2Q] = Ox200000L; m_RawVals [kHiCutoffFreq] = OX600000L; m_RawValε [kHiCutoffQ) = Ox200000L; m_RawVals [kLoCutoffFreq) = 0X40000L; m_RawValε [kLoCutoffQ] = Ox200000L; m_DSPReturn = 0; for! i = 0 ; i < kUIArraySize ; i++ )
{
SetParamValue (- 1, i) ;
) m_DSPVals [kDSPBypassMaεk) = m_RawValε [kBypaεsMask] = OL; SendDSPValue (kDSPBypassMask) ;
} void CDSP56kManager : :SetNotch6Freq(long value)
SetNotchFreq (value, kNotch6Freq) ; } void CDSP56kManager: :SetNotch6Q(long value) {
SetNotchQ(value,kNotch6Q,kNotch6Freq) ;
} void CDSPS6kManager: :SetNotch6Cut (long value) {
SetBoostCu (value, kNotch6Cut) ; } void CDSP56kManager : :SetNotch7Freq(long value) (
SetNotchFreqlvalue, Notch7Freq) ;
void CDSP56kManager : : SetNotch7Q ( long value) {
SetNotchQ(value, kNotch7Q, kNotch7Freq) ; void CDSP56kManager SetNotch7Cut ( long value ) (
Set BoostCu (va lue , Notch7Cut ) ; }
t CDSP56kManager : - GetHDCDMode O
// SetParamValue ( - 1 , kMainVolume) , // return ! m_DSPReturn ) , return ! m Comm- GetDetectState ( ) ) ,
void CDSPδGkManager : : SetAnalogInput ( long value ) { i f ( value >= 0 )
SetRawValue (value, Analogln) ; if( m_RawVals [kAnalogln] ) m_DSPVals [kDSPAnalogln] = 0x7FFFFF; elεe m_DSPValε [kDSPAnalogln] = 0; SendDSPValue (kDSPAnalogln) ,-
BOOL CDSP56kManager: :IεReady()
return! m Comm->CheckState() ),
void CDSP56kManager: :GetPureStringValue (int which, CString tstr)
{ int coun ;
GetStringValue (which, tr) ; εtr.TrimLeft () ,- count = εtr. Find (' ' ) ; if! count >= 0 ) str = str. Left (count) ,-
) void CDSP56kManager: : GetStringValue (int which, CString εstr) { double value; char s [100] ,- switch! which )
{ case kAnalogVolume: case kMainVolume: case kPreVolume: value = m_RawVale [which] ,- value /= DSP_CONTROL_MAX; value = 20 * loglO (value) ; sprintf (s, "%10.2f dB", value), εtr = s ; break, case kHiCutoffFreq:
/* value = m_RawVals [which] , value /= DSP_CONTROL_MAX; // normalize value *= FHCRANGE2; 90
value += FHCBOTRANGE2. value = (powfio .value) - 1 )/(10 -1 ), value *= SAMPLING_FREQ/2, */ value = DoConvertFreqRange (m_RawVals (kHiCuto fFreq] , FHCTOPRANGE3 , FHCBOTRANGE3 ) sprintf (s, "%10 2f Hz", value), εtr = s, break, case kHιCutoff2Q value = DSP_CONTR0L_MAX - m_RawVals (kHiCutoff2Q] , value /= DSP_CONTROL_MAX, // normalize value = QHC2TOP-QHC2BOT, value += QHC2BOT, value = (pow(10 .value) - 1 )/(10 -1 ), sprint (s, "%10 2f", value), str = s, break, case kHiCutoffQ value = m RawVals [kHiCutoffQ] , value /= DSP_CONTROL_MAX, // normalize value *= QLCRANGE, value += QLCBOTRANGE; value = (pow(10., value) - l.)/(10.-l ), f ( value >= 1. ) value = 0 99999; sprintf (s, "%10.2f".value) ; εtr = ε, break; caεe kLoCutoffFreq: value = m_RawVals [kLoCuto Freq] ; value /= DSP_CONTROL_MAX; // normalize value *= (FLCTOPRANGE2-FLCBOTRANGE2) ; value += FLCBOTRANGE2 ; value = (pow( 10..value) - 1. ) / (10. -1. ) ; sprintf (s, "%10.2f Hz", value) ; str = s, break, case kLoCutoffQ: value = m_RawVals [kLoCutof Q] ; value /= DSP_CONTROL_MAX; // normalize value *= QLCRANGE; value += QLCBOTRANGE; value = (pow(10..value) - 1. ) / (10. -1. ) ; ιf( value >= 1. ) value = 0 99999 ; sprintf (ε, "%10.2f ",value) ; εtr = ε, break, case kLoShelfFreq: value = m_RawValε [kLoShelfFreq] ; value /= DSP_CONTROL_MAX; // normalize value *= FLCRANGE; value += FLCBOTRANGE, value = (pow(10 .value) - l.)/(10.-l ) ; value *= SAMPLING_FREQ/2 ; sprint (s, "%10.2f Hz", value) ; str = s, break, case kHiShelfFreq- value = m RawVals [kHiShel Freq] , value /= DSP_CONTROL_MAX; // normalize value *= FHCRANGE2; value += FHCBOTRANGE2 ; value = (pow(l0 .value) - 1 )/(10.-l ), value *= SAMPLING_FREQ/2; sprint (s. "%10 2f Hz", value), str = s , break case kNotchlCut case kNotch2Cut case kNotch3Cut case kNotch4Cut case NotchSCut case NctchGCut case KNotch7Cut case kNotchβCut case kNotch9Cut case kNotchACut. case kLoShelfGain case kHiShelfGain value = 20 * ConvertBoostCu Range (m_RawVals [which) ) ; sprint (s, "%10 2f dB", value), str = s, break, case kNotchlFreq case k_Notch2Freq case kNotch3Freq. case kNotch4Freq case kNotchSFreq- caεe kNotchβFreq- caεe kNotch7Freq- case kNotchβFreq: caεe kNotch9Freq: case kNotchAFreq: case kAllpassFreq: value = ConvertFreqRange (which) ; value *= SAMPLING_FREQ/2; sprintf (s, "%10.2f Hz",value) ; εtr = ε ; break; caεe kHiCutof 2Freq: value = DoConvertFreqRange (m_RawVals [kHiCutoff2Freq] , FHC2TOP, FHC2BOT) ; sprintf (s, "%10.2f Hz", value) ; εtr = s; break; case kNotchlQ- caεe kNotch2Q: case kNotch3Q- caεe kNotch4Q- caεe kNotchSQ- caεe kNotch6Q: case kNotch7Q: case kNotchβQ- caεe kNotch9Q: caεe kNotchAQ: case kAllpaεεQ: value = ConvertQRange (m_RawValε [which] ) ; sprint (s, "%10.2f", value) ; str = s, break; case kDelay: value = m_RawVals [which] ; value /= DSP_CONTROL_MAX; value *= DELAY_LENGTH; value /= SAMPLING_FREQ; value *= 1000. ; sprintf (ε, "%10 2f mS", value) ; εtr = s, break, default εtr = "fixed"; break, )
}
BOOL CDSP56kManager IεBusy!) ( return! m_Comm->IsTransmιttmg ( ) ),
void CDSP56kManager SetBypassSection (BOOL value, int which) { long mask = 1L < which , ιf( value )
{ m_RawVals [kBypassMask] |= mask,
> else
{ mask = -mask, m_RawVals [kBypassMask] k= mask,
) m_DSPVals [kDSPBypassMask] = m_RawVals [kBypaεsMask] , SendDSPValue (kDSPBypassMask) ,
}
BOOL CDSP56kManager GetBypassSect ion (int which) { long mask = 1L << which, return ( (m_RawVals [kBypassMask] t mask) != 0 ),
} void CDSP56kManager: :SetDelay (long value) { if ( value >= 0 )
SetRawValue (value, Delay) , m_DΞPVals [kDSPDelay] = m_RawVals [kDelayJ ; SendDSPValue (kDSPDelay) ,-
// UI IDS enum ( kMainVolume, kLoShel Freq, kLoShelfGain, kHiShelfFreq, kHiShelfGa , kNotchlFreq, kNotchlQ, kNotchlCut , kNotch2Freq, kNotch2Q, kNotch2Cut, kNotch3Freq, kNotch3Q, kNotch3Cut. kNotch4Freq, kNotch4Q, kNotch4Cut, kNotchδFreq, kNotch5Q, kNotch5Cut, kPreVolume, kBypass, kLoCutof Freq, kLoCutoffQ, kHiCutoffFreq, kHiCutoffQ, kHDCDBypass, kHDCDGainScaleOff , kDDXCompBypass , kNotch6Freq, kNotchδQ, kNotch6Cut, kNotch7Freq, kNotch7Q, kNotch7Cut, kAnalogln, kAnalogVolume, kDelay, kAllpassFreq, kAllpassQ, kBypasεMask, kHiCutoff2Freq, kHiCutoff2Q, kNotchβFreq, kNotchβQ, kNotchβCut, kNotch9Freq, kNotch9Q, kNotch9Cut, kNotchAFreq, kNotchAQ, kNotchACut , kDBNotchWidth
((define kUIArraySize (kDBNotchWidth+1)
// orphaned control IDs /*
((define kNotch6Freq (10000+20) ((define kNotch6Q (10000+21) ((define kNotch6Bθoεt (10000+22) ((define kNotch7Freq (10000+23) ((define kNotch7Q (10000+24) ((define kNotch7Boost (10000+25) ((define kLoShelf2Freq (10000+26) ((define kLoShel 2Boost (10000+27) ((define kHiShel 2Freq (10000+28) ((define kHiShelf2Boost (10000+29) 94
'/
// DSP IDs enu { kDSPMainVolume, kDSPLoShelfFreq, kDSPLoShelfGain, kDSPHiShelfFreq, kDSPHiShelfGain, kDSPNotchlFreq, kDSPNotchlQ, kDSPNotchlCut, kDSPNotch2Freq, kDSPNotch2Q. kDSPNotch2Cut, kDSPNotch3Freq, kDSPNotch3Q, kDSPNotch3Cut, kDSPNotch4Freq, kDSPNotch4Q, kDSPNotch4Cut, kDSPNotchSFreq, kDSPNotch5Q, kDSPNotchSCut, kDSPPreVolume, kDSPBypass, kDSPLoCuto fScale, kDSPLoCutoffFc, kDSPLoCutoffQc, kDSPHiCutoffScale, kDSPHiCutoffA2, kDSPHiCutoffAl, kDSPHDCDBypass, kDSPHDCDGainScaleOff, kDSPDDXCompBypass , kDSPNotch6Freq, kDSPNotchβQ, kDSPNotchGCut, kDΞPNotch7Freq, kDSPNotch7Q, kDSPNotch7Cut, kDSPAnalogln, kDSPAnalogVol, kDSPBypassMaεk, kDSPDelay, kDSPAllpassFreq, kDSPAllpaεεQ, kDSP2HiCutoffScale , kDSP2HiCutoffA2, kDΞP2HiCutoffAl, kDSPNotchβFreq, kDSPNotchβQ, kDSPNotchβCut, kDSPNotch9Freq, kDSPNotch9Q, kDSPNotch9Cut, kDSPNotchAFreq, kDSPNotchAQ, kDSPNotchACut
1;
((define kDSPArraySize (kDSPNotchACut+1)
// bit definitions for kDSPBypassMask above enum { kBypassNotchl , kBypas8Notch2, kBypassNotch3 , kBypassNotch4 , kBypassHipaεs , kBypassLopass, kBypassLoshelf , kBypassHiShelf , kBypassConecry, kBypasεAllpaεs , kBypassDBNotch, kBypasεNLopass
((if ! defined (AFX_DBNOTCH_H 241CC3C5_14D9_11D3_96EE_00G097CDB9E2 INCLUDED_)
((define AFX_DBNOTCH_H 2 1CC3C5_1 D9_11D3_96EE_OOG097CDB9E2 INCLUDED_
(f i f _MSC_VER >= 1000
((pragma once ffendif // _MSC_VER >= 1000
// DBNotch . h : header f ile
// class CTabDialog ; uiuuiiiiiuuuuu mi ui/uuuuuuuuu in mil ui/uu/uuu uu/1
II CDBNotch dialog class CDBNotch : public CPropertyPage
{
DECLARE_DYNCREATE (CDBNotch)
// Construction public:
CDBNotch () ;
-CDBNotch!) ;
// Dialog Data
// { {AFX_DATA (CDBNotch) enum { IDD = IDD_PP11 } ; CButton m_Bypass; CSliderCtrl m_CompGainSlider,- CSliderCtrl m_CompQSlider; CSliderCtrl m_QSlider; CSliderCtrl m_FreqSlider; //}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL (CDBNotch) . protected: virtual void DoDataExchange (CDataExchange* pDX) ; // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation protected:
// Generated message map functions
//{ {AFX_MSG (CDBNotch) afx_msg void OnVScroll (UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) ; afx_msg void OnPaint ; virtual BOOL OnlnitDialo () ; afx_msg void OnBypass () ;
//}}AFX_MSG
DECLARE_MESSAGE_MAP ( )
CTabDialog *m_ParentWindow; void SendStringToUI (int which);
// { {AFX_INSERT_LOCATION} }
// Microsoft Developer Studio will insert additional declarations immediately before the previous line. ffendif // 'defined (AFX DBNOTCH_H 241CC3C5_14D9_11D3_96EE_006097CDB9E2 INCLUDED_) // DBNotch cpp implementation file //
((include "stdafx h'
((include "sa h"
((include "DBNotch h"
((include "TabDialog h"
((include "DSP56kManager h" fflfdef _DEBUG ((define new DEBUG_NEW ((undef 1HIS_FILE static char TΗIS_FILE[] = FILE ffendif
II CDBNotch property page IMPLEMENT_DYNCREATE (CDBNotch CPropertyPage)
CDBNotch CDBNotch () CPropertyPage (CDBNotch IDD)
{
//{ {AFX_DATA_INI (CDBNotch)
// NOTE the ClassWizard will add member initialization here
//} }AFX_DATA_INIT )
CDBNotch -CDBNotch 0
{
} void CDBNotch DoDataExchange (CDataExchange* pDX)
{
CPropertyPage DoDataExchange (pDX) ,
//{ {AFX_DATA_MAP (CDBNotch)
DDX_Control (pDX, IDC_CHECK5, m_Bypasε) ,
DDX_Control(pDX, IDC_SLIDER6, m_CompGaιnSlιder) ,
DDX_Control(pDX, IDC_SLIDER5, m_CompQSlιder) ,
DDX_Control(pDX, IDC_SLIDER2, m_QSlιder) ,
DDX_Control(pDX, IDC_SLIDER1, m_FreqSlιder) ,
//} )AFX_DATA_MAP }
BEGIN_MEΞSAGE_MAP (CDBNotch, CPropertyPage)
// { {AFX_MΞG_MAP (CDBNotch)
ON_WM_VSCROL ()
ON_WM_PAINT()
ON_BN_CLICKED(IDC_CHECK5, OnBypaεε)
//}}AFX_MSG_MAP END_MESSAGE_MAP ( ) uu/uuiuuii/u/uu/u/uu/uu/uu/uu/uu/uiuu/uu/uuiuu"
II CDBNotch mesεage handlers void CDBNotch OnVScroll (UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO Add your meεsage handler code here and/or call default CSliderCtrl «εlιder = (CSliderCtrl * (pScrollBar , int which,
CPropertyPage OnVScroll (nSBCode nPoε pScrollBar)
Sleeρ(SO) ιf( slider == &m_FreqSlιder ) which = kNotch9Freq else ιf( εlider == &m_QSlιder ) which = kNotch9Q else ιf( εlider =- _.m_CompQSlιder ) which = kNotchβQ elεe ιf( εlider == 6m_CompGaιnSlιder ) which = kNotchβCut else re urn; g_DSPManager->SetParamValue (CONTROL_RANGE- εlider- >Ge Pos () .which) ; SendStringToUI (which) ;
void CDBNotch: :OnPain () {
CPaintDC dc(thiε); // device context for painting
// TODO: Add your message handler code here m_FreqSlider .SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kNotch9Freq) ) ; m_QSlider.SetPoε (CONTROL_RANGE-g_DSPManager->GetParamValue (kNotch9Q) ) ; m_CompQSlider .SetPos (CONTROL_RANGE-g_DSPManager- >GetParamValue (kNotchβQ) ) ; m_CompGainSlider .SetPos (CONTROL_RANGE-g_DSPManager- >GetParamValue (kNotchβCut) ) m_Bypass .SetCheck (g_DSPManager->GetBypasεSection (kBypassDBNotch) ) ;
// Do not call CPropertyPage : :OnPaint 0 for painting messages }
BOOL CDBNotch: : OnlnitDialog () {
CPropertyPage: : OnlnitDialo () ;
// TODO: Add extra initialization here m_FreqSlider . SetRange ( 0 , CONTROL_RANGE) ; m_FreqSlider. SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kNotch9Freq) ) ; m_FreqSlider. SetTicFreq ( (CONTROL_RANGE+l) /16) ; m_QSlider. SetRange ( 0 , CONTROL_RANGE) ; m_QSlider. SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kNotch9Q) ) ; m_QSlider.SetTicFreq( (CONTROL_RANGE+l) /16) ; m_CompQSlider. SetRange (0, CONTROL_RANGE) ; m_CompQSlider.SetPoε (CONTROL_RANGE-g_DSPManager->GetParamValue (kNotchβQ) ) ; m_CompQSlider.SetTicFreq( (CONTROL_RANGE+l) /16) ; m_CompGainSlider .SetRange (0, CONTROL_RANGE) ; m_CompGainSlider. SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kNotchBCut) ) , m_CompGainSlider. SetTicFreq ( (CONTROL_RANGE+l) /1G) ;
m_ParentWindow = (CTabDialog *) GetParent () - GetParent () ; return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CDBNotch: : SendStringToUI (int which) {
CString str; g_DSPManager->GetStringValue (which, str) ; m_ParentWindow->SetStatusΞtring (0, εtr) ,-
void CDBNotch: : OnBypass () {
// TODO: Add your control notification handler code here int state = m_Bypass .GetState () & 0x3; g_DSPManager->SetBypassSection (state, kBypasεDBNotch) ; // Ma Page cpp implementation file //
((include "εtdafx h" ((include "sa h" ((include "MainPage h" ff include "TabDialog h" ff include "DSP56kManager h"
((include <stdlιb h> ffifdef _DEBUG ((define new DEBUG_NEW tfundef THIS_FILE static char THIS_FILE[] = FILE , ffendif mum iiuiiiiumii muni
11 CMainPage property page
IMPLEMENT_DιNCREATE (CMainPage, CPropertyPage)
CMainPage : :CMainPage ( ) : CPropertyPage (CMainPage : : IDD) {
// { {AFX_DATA_INIT (CMainPage) m_BypassCheckBox = FALSE; m_HDCDBypass = FALSE; m_GainScaleBypass = FALSE ; m_AnalogInput = FALSE; // } } AFX_DATA_INIT
CMainPage : : -CMainPage ( )
void CMainPage : : DoDataExchange (CDataExchange* pDX)
{
CPropertyPage: : DoDataExchange (pDX) ,- // { (AFX_DATA_MAP (CMainPage) DDX_Control (pDX, IDC_SLIDER8, m_Delay) ;
DDX_Control (pDX, IDC_SLIDER7, m_AnalogVol ) ; DDX_Control (pDX, IDC_BUTTONl , m_ReεetAll) ; DDX_Control (pDX, IDC_SLIDER3, m_PreVolumeSlider) DDX_Control (pDX, IDC_SLIDER1 , m_VolumeSlider) ; DDX_Check(pDX, IDC_CHECK1 , m_BypaεsCheckBox) ; DDX_Check(pDX, IDC_CHECK2 , m_HDCDBypass) ;
DDX_Check (pDX, IDC_CHECK3 , m_GainScaleBypass) ; DDX_Check (pDX, IDC_CHECK4 , m_AnalogInput) ; / / } } AFX_DATA_MAP
BEGIN_MESSAGE_MAP (CMainPage, CPropertyPage)
//( {AJ7X_MSG_MAP (CMainPage)
ON_WM_VSCROLL ( )
ON_WM_SHOWWINDOW( )
ON_BN_CLICKED(IDC_CHECKl, OnBypassBut on)
ON__WM_PAINT ( )
ON_BN_CLICKED ( IDC_CHECK2 , OnHDCDBypass)
ON_BN_CLICKED ( IDC_CHECK3 , OnGalnScaleBypass)
ON_BN_CLICKED(IDC_BUTTONl, OnResetAll)
ON_BN_CLICKED(IDC_CHECK4, OnAnalogInput)
//}}AFX_MSG_MAP END_MESSAGE_MAP ( )
111111/ιιιιιtιιιιιιιιιιιιιιιιιιιιιιιιιιιιιιιι I/mum uu/ IIIIIU/II/UUII
II CMainPage meεεage handlers void CMainPage OnVScroll (UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) // TODO- Add your message handler code here and/or call default CSliderCtrl -slider = (CSliderCtrl *) pScrollBar . int which,
CPropertyPage OnVScroll (nSBCode, nPos, pScrollBar),
Sleep(50) , if ( slider == £,m_VolumeSlιder) which = kMainVolume, else if (slider == &m_PreVolumeSlιder) which = kPreVolume, else if (slider == &m_AnalogVol) which = kAnalogVolume ; else if (slider == &m_Delay) which = kDelay, else return; g_DSPManager->SetParamValue (C0NTR0L_RANGE- slider- >GetPos () , which) , SendStringToUI (which) ;
BOOL CMainPage: : OnlnitDialog ()
{
CPropertyPage : : OnlnitDialog ( ) ,-
// TODO : Add extra initialization here m_VolumeSlider . SetRange ( 0 , CONTROL_RANGE) ; m_VolumeSlider . Set Pos (CONTROL_RANGE-g_DSPManager- GetParamValue (kMainVolume) ) ; m Volu eSlider . SetTicFreq ( (CONTROL_RANGE+1) /1G) ; m_VolumeSlider . SetPageSize ( PG_CONTROL_AMT) ; m_PreVolumeSlider . SetRange ( 0 , CONTROL_RANGE) ; m_PreVolumeSlider - SetPoε (CONTROL_RANGE-g_DSPManager->GetParamValue (kPreVolume) ) m_PreVolumeSlider . SetTicFreq ( (CONTROL_RANGE+l) /16) ; m_PreVolumeSlider . SetPageSize (PG_CONTROL_AMT) ; m_AnalogVol . SetRange ( 0 , CONTROL_RANGE) ; m_AnalogVol . SetPos (CONTROL_RANGE-g_DΞPManager- >GetParamValue (kAnalogVolume) ) ; m_AnalogVol . SetTicFreq ( (CONTROL_RANGE+1) /16) ; m_AnalogVol . SetPageSize ( PG_CONTROL_AMT) ; m_Dela . SetRange ( 0 , CONTROL_RANGE) ; m_Delay . SetPoε (CONTROL_RANGE-g_DSPManager- >GetParamValue (kAnalogVolume) ) ; m_Delay . SetTicFreq ! (CONTROL_RANGE+l) /16 ) ; m_Delay . SetPageSize ( PG_CONTROL_AMT) ; m_BypassCheckBox = false ; m ParentW dow = (CTabDialog *) GetParent () - >GetParent () ,- return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION : OCX Property Pages should return FALSE ) void CMainPage - - OnShowWindow (BOOL bshow, UINT nStatuε)
{
CPropertyPage - OnShowWindow (bShow, nStatus) ;
// TODO - Add your mesεage handler code here
void CMainPage OnBypassButton 0
{
// TODO Add your control noti f ication handler code here m_BypasεCheckBox = ' m_BypassCheckBox; g_DSPManager - >SetBypass (m_BypassCheckBox) ;
} void CMainPage OnPaint O CPaintDC dc(thιs) // device context for painting
// TODO Add your message handler code here m_VolumeSlιder SetPoε (CONTROL_RANGE g_DSPManager-;-GetParamValue (kMainVolume ) ) m_PreVolumeSlιder Set os (CONTROL_RANGE g_DSPManager->GetParamValue (KPreVolume) ) m_ΛnalogVol Se Pos (CONTROL_RANGE-g_DSPManager- >GetParamValue (kAnalogVolume) ) m_Delay SetPos (CONTROL_RANGE-g_DSPManager- >Get Para Value (kDelay) ) ,
// Do not call CPropertyPage OnPaintO for painting messages
void CMainPage OnHDCDBypass ( )
(
// TODO Add your control notification handler code here m_HDCDBypass = 'm_HDCDBypass , g_DSPManager->SetHDCDBypass (m_HDCDBypass) ,
) void CMainPage: :OnGainScaleBypass ()
{
// TODO Add your control notification handler code here ra_GaιnScaleBypass = im GaiπScaleBypass; g_DSPManager-?SetHDCDGainScale (ra_GainScaleBypass) ;
void CMainPage: :OnResetAll ( )
(
// TODO. Add your control notification handler code here
// MM 8/3/99 Added extra dialog warning if ( MessageBox( "Are you sure you want to reset all parameters? " , "WARNING" , MB YESNO) ' = IDYES ) re urn; g_DSPManager->ResetAll () ; m_VolumeSlider. SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kMainVolume) ) , m_PreVolumeSlιder SetPos (CONTROL_RANGE-g_DSPManager- >GetParamValue (kPreVolume) ) , m_AnalogVol . SetPoε [CONTR0L_RANGE-g_DSPManager->GetParamValue (kAnalogVolume) ) , m_Delay. SetPos (CONTROL_RANGE g_DSPManager- >GetParamValue (kDelay) ) ;
} void CMainPage: .OnAnaloglnpu ()
{
// TODO. Add your control notification handler code here m_AnalogInput = !ra_AnalogIπpu , g_DSPManager->SetAnalogInput (m_AnalogInput) ;
} void CMainPage: -SendStringToUI (mt which) (
CString str; g_DSPManager- GetStrιngValue (which, str) ; m_ParentWindow->SetStatusStrmg (0, εtr) ; ffif .'defined (AFX_MAINPAGE_H 90463DA4_D52E_11D2_9GEE_006097CDB9E2 INCLUDED_)
((define AFX_MAINPAGE_H 9046 DA4_D52E_11D2_96EE_OOG097CDB9E2 INCLUDED_
#if _MSC_VER >= 1000 ((pragma once ffendif
// _MSC_VER >= 1000
// MainPage.h .- header file
//
clasε CTabDialog;
1/ CMainPage dialog class CMainPage : public CPropertyPage
{
DECLARE_DYNCREATE (CMainPage)
// Construction public:
CMainPage!) ;
-CMainPage!) ;
// Dialog Data
//{ {AFX_DATA (CMainPage) enu { IDD = IDD_PP2 }; CSliderCtrl m_Delay; CSliderCtrl m_AnalogVol; CButton m_ResetAll; CSliderCtrl m_PreVolumeSlider; CSliderCtrl m_VolumeSlider; BOOL m_BypasεCheckBox; BOOL m_HDCDBypaεs; BOOL m_GainScaleBypass; BOOL m_AnalogInput; //}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
// { {AFX_VIRTUA (CMainPage) protected: virtual void DoDataExchange (CDataExchange* pDX) ,- // DDX/DDV support
//})AFX_VIRTUAL
// Implementation protected:
// Generated message map functions
// { {AFX_MSG (CMainPage) afx_msg void OnVScroll (UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); virtual BOOL OnlnitDialog 0 ,- afx_msg void OnShowWindow (BOOL bShow, UINT nStatus) ; afx_msg void OnBypassButton () ,- afx_msg void OnPaintO; afx_msg void OnHDCDBypaεs () ; afx_mεg void OnGainΞcaleBypaεs () ; afx_msg void OnReεetAll () ; afx_msg void OnAnalogInput () ;
//}}AFX_MSG
DECLARE_MESSAGE_MAP ( )
CTabDialog *m_ParentWindow; void SendStringToUI (int which); private -
// { {AFX_INSERT_LOCATION} } // Microsoft Developer Studio will insert additional declarations immediately before the previous lme dendlf // 'defιned(AFX_MAINPAGE_H 90463DA4_DS2E_11D2_96EE_006097CDB9E2 INCLUDED )
// I2CIPortComm.h: interface for the I2CIPortComm class. // ii mum ui mini iiiimiiiiiimiuu i/i/ii/ii
Kif !defined(AFX_I2CIPORTCOMM_H 33F9EF07_FGEF_11D2_9GEE_006097CDB9E2 INCLUDED_)
((define AFX_I2CIPORTCOMM_H 33F9EF07_F6EF_11D2_96EE_006097CDB9E2 INCLUDED_ ffif _MSC_VER >= 1000
((pragma once dendif // _MSC_VER >= 1000
((include "DSPComm.h"
enum (
MI2C_STATE_CLOSED, MI2C_STATE_PEND1NG_0PEN, MI2C_STATE_OPEN, MI2C_STATE_PENDING_TX, MI2C STATE PENDING RX
((define MI2_BUFFER_SIZE (3*3000) // should be multiple of 3 class I2CIPortComm : public DSPComm
{ int m_εtate; int m_error_code ; long m_TxReq; char m_tx_buffer[MI2_BUFFER_SIZE] ; long m_tx_write , m_tx_read; long m_detect ;
BOOL m_get_detect ; long m_retryCoun ;
BOOL m_ini tialTry;
HWND m_HWnd ; public -. virtual BOOL IsTransmitt ing (void) ; virtual long GetDetectState (void) ; virtual void MessageHandler (WPARAM iPortEventCode ) ,- virtual BOOL CheckState (void) ,-
I2CIPortComm (HWND p) ; virtual -I2CIPortComm ( ) ; virtual long SendDSPWord ( long) ,- virtual long SendDSPMemory (char * , loπg) ;
} ;
(fendif // ! def ined (AFX I2CIPORTCOMM H 33F9EF07_F6EF_11D2_9GEE_006097CDB9E2 INCLUDED_)
// I2CI PortComm cpp implementat ion of the I2CI PortComm class //
I U III U UU III II mil in in uu I uiiiii UI
((include "stdafx h"
((include "sa h"
((include " I2CIPortComm h"
((include "COMPortChooser h"
((include "ι2c200 h" static struct I2C_PROP ι2c, static I2CIPortComm *g_I2CComm = NULL,
((define I2C_SLAVE_ADDRESS OxBO
((define 12C_MAX_AMOUNT (5*3) // don't send more than thiε in one-shot
((define I2C_RETRY_COUNT 0 fflfdef _DEBUG ffundef THIS_FILE static char THIS_FILE[]= FILE ,
((define new DEBUG_NEW (fendif
//εtatic t cb_message, void iPortMsgHandler (WPARAM iPortEventCode) { if ( g_I2CComm ) g_I2CComm- :>MessageHandler (iPortEventCode) ;
II Ulll III lllimiUII II II IllllltlllllUIII 11 iiiiiiiiiiuiii
1/ Construction/Destruction
Ulll 'II ///////////////
/static BOOL wait_for_message(voιd)
{ long coun , while ( cb_meεsage == -1 )
{
Sleep(lOO) ; count++; ιf( count > 20 ) return( false ) ,-
} return! true ) ;
}*/
I2CIPortComm I2CIPortComm(HWND p) {
CCOMPortChooεer dig, dig DoModal!) , m_error_code = 0, m_εtate = MI2C_STATE_CLOSED, m_TxReq = 0, m_tx_wrιte = m_tx_read = 0, m_detect = 0, m_get_detect = falεe, m_ιnιtιalTry = falεe, m_HWnd = p , ι2c comport = dig whιch_ρort. 1/11918
106
i2c WmMsgNo = 0 , i2c pfCBF = i PortMsgHandler , ff i fdef NDEBUG ι2c pcLogFileName = NULL, flelse i2c pcLogFi l eName = " log txt " . ι2c LogFileLevel = 1, ι2c LogFileSize = 1000; i2c HostSlaveAddr = 0x6E; ι2c BusTi eOut = 1000, ι2c MasterBitRate = 2; // 100 kHz ι2c MasterRxBufSize = 512; ι2c MasterTxBufSize = MI2_BUFFER_SIZE, ι2c MasterArbRetry = 0, i2c SlaveRxGCEnable = 1, i2c SlaveRxBufSize = 512; i2c SlaveTxBufSize = 512; r = I2COpen (m_HWnd, AfxGetlnstanceHandle () , εi2c) iff. r ) m_error_code = 0x1000; m_εtate = MI2C_STATE_PENDING_OPEN; g_I2CCorπm = this;
I2CIPortComm: :-I2CIPortComm() {
I2CClose() ; g_I2CComm = NULL;
long I2CIPortComm: : SendDSPWord (long value) { char buf er [3] ; i ( m_εtate < MI2C_STATE_OPEN ) return ( 0L ) ; buffer [0] = (value » IG) & OxFF; buffer(l) = (value >> 8) & OxFF; buffer [2] = value & OxFF; return( SendDSPMemory (buffer, 3) ) ;
long I2CIPortComm: -SendDSPMemory (char *data, long len) {
// make sure the link iε valid if( m_εtate < MI2C_STATE_OPEN ) return ( 0L ) ; long rval = 0L; long b; long tocopy, amount, freespace;
// copy data into the tx buffer if( data )
{ freespace = m_tx_read - m_tx_write; if( freespace <= 0 ) freespace += MI2_BUFFER_SIZE; ASSERTf (len + 3) <= freespace ); // not enough space in the buffer for ( tocopy = len , tocopy > 0 , tocopy -= amount ) { if( m_tx_wrιte >= m_tx_read ) f amount = MI2_BUFFER_SIZE - m_tx_wrιte, ) else
{ amount = m_tx_read - m_tx_wrιte,
) amount = mm (amount , tocopy) , memcpy(m tx_bu fer+m_tx_wrιte, data, amount) , data += amount, m_tx_wrιte += amount, m_tx_wnte %= MI2_BUFFER_SIZE, ) }
// attempt to send it ιf( m_state == MI2C_STΛTE_OPEN )
{ amount = m_tx_wrιte - m_tx_read; // ASSERT) amount == ((amount / 3) * 3) ), ιf( amount < 0 ) amount = MI2_BUFFER_SIZE - m_tx_read; // amount = (amount / 3) * 3; // Send complete DSP Words, amount = min (amount, 12C_MAX_AMOUNT) , // throttle b = I2CMasterTx(I2C_SLAVE_ADDRESS, (unεigned char *) m_tx_bu fer+m_tx_read , amount, 1), if! b == 0 )
{ m_state = MI2C_STATE_PENDING_TX; m_TxReq = amount ,- if! !m_initialTry )
{ m_retryCount = 0, m_initιalTry = true; } ) else
{ ιf( m_error_code == o ) m_error_code = b; ASSERT(b == 0) ; } } return! rval ) ;
void I2CIPortComm: .-MessageHandler (WPARAM iPortEventCode) { struct I2C_PROP si2c, int r,- long tx_count; long val; unεigned char buffer (lθ) ; εwitch ( m_εtate ) { case MI2C_STATE_PENDING_OPEN - if ( iPortEventCode == I2C_OPEN_SUCCESSFUL )
{ m_εtate = MI2C_STATE_OPEN, if( m_tx_read '= m_tx_wnte ) SendDSPMemory (NULL, 0L) ,
} else m_error_code = i PortEventCode , break , case MI2C_STATE_PENDING_RX ι f ( IPortEventCode == I 2C_MRX_COMPLETE )
{ r = I2CGetMasterRxMs ( 3 , bu fer) , ιf ( r == 3 ) val - buffer[0) £. OxFF val << 8 val = val | (buffer [1] & OxFF) val << 8 val - val | (buffer [2] OxFF) m detect = val
//else
// m_error_code = iPortEventCode m_state - MI2C_STATE_OPEN ιf( m_tx_read '= m_tx_wπte )
SendDSPMemory (NULL OL) break case MI2C_STATE_PENDING_TX ιf( IPortEventCode == I2C_MTX_COMPLETE )
{
// MM 5/20/99 Don't call status here // r = I2CGetStatus(&sι2c) ,
// tx_count = sι2c MaεterTxByteCount , tx_count = m_TxReq, m_ιnιtιalTry = false,
} else
{ m_retryCount++, ι f ( m_retryCount > I2C_RETRY_COUNT )
{ m imtialTry = false, ιf( m_error_code == 0 ) m_error_code = iPortEventCode, //ASSERT(m_retryCount <= I2C_RETRY_COUNT) , I2CClose() , r = I2COpen(m_HWnd,AfxGetInstanceHandle() , &ι2c) , ASSERT( r == 0 ) , m_εtate = MI2C_STATE_PENDING_OPEN, return,
} tx_count = 0 ,
} m_state = MI2C_STATE_OPEN, m_tx_read += tx_count, m_tx_read %= MI2_BUFFER_SIZE, ιf( m_get_detect )
{ m_get_detect = falεe, r = I2CMaεterRxExt(I2C_SLAVE_ADDREΞS,3 1,1), ιf( r )
{ ιf( m_error_code == 0 ) m_error_code = r,
} else m_εtate = MI2C_STATE_PENDING_RX, } else ιf( m_tx_read '= m_tx_wπte )
SendDSPMemory (NULL, OL) , break
/* case MI2C_STATE_PENDING_TX ιf( IPortEventCode == I2C_MTX_COMPLETE ) { r = I2CGetStatus (&sι2c) , ιf( m_TxReq == sι2c MasterTxByteCount )
{ m_εtate = MI2C_STATE_OPEN m_tx_read += m_TxReq , m_tx_read %= MI2_BUFFER_SIZE ι f ( m_tx_read ' = ra_tx_wrι te ) SendDSPMemory (NULL, OL) ) else
{ m_error_code = iPortEventCode; ,m_tx_read = m_tx_write = 0; m_state = MI2C_STATE_OPEN; if( m_tx_read != m_tx_write ) SendDSPMemory (NULL, OL) ;
} break; */
)
BOOL I2CIPortComm: : CheckState ( ) { return! m_εtate == MI2C_STATE_OPEN )
) long I2CIPortComm: :GetDetectState ()
long r.rval = 0; if( m_error_code )
{ rval = -m_error_cσde; m_error_code = 0 ,-
} else
{ rval = ( m_detect ) ? 1 : 0;
}
/*if( m_state == MI2C_STATE_PENDING_TX ) m_get_detect = true; elεe if( m_εtate == MI2C_STATE_OPEN )
{ r = I2CMaεterRxExt (I2C_SLAVE_ADDRESS, 3,1,1) , if! r ) m_error_code = r; else m_εtate = MI2C_STATE_PENDING_RX; r Weturn! rval ) ;
BOOL I2CIPortComm: : IsTransmitting () { return! m_tx_write != m_tx_read ), ) ff lf 'defined (AFX_I2CDIALOG_H BSDS 10Ξ6_F7D5_11D2_96EE_006097CDB9E2 INCLUDED_)
{(define AFX_I2CDIALOG_H BSDS10E6_F7D5_11D2_9SEE_006097CDB9E2 INCLUDED_
= 1000 der f ile
Figure imgf000111_0001
II I III II II II UUIUII III! Ulll lUUUUIIIIIUIIUIIItl II CI2CDιa log dialog class CI2CDιalog public CDialog
(
UINT m_tιmerID, int m_state,
// Construction public
CI2CDιalog (CWnd* pParent = NULL), // standard constructor
// Dialog Data
//{{AFX_DATA(CI2CDιalog) enum { IDD = IDD_DIALOG2 } ;
// NOTE the ClassWizard will add data members here
//})AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{ {AFX_VIRTUAL(CI2CDιalog) public virtual BOOL OnCmdMsg (UINT nlD, mt nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerlnfo) , protected virtual void DoDataExchange (CDataExchange* pDX) ; // DDX/DDV support
//}}AFX VIRTUAL
// Implementation protected -
// Generated message map functions //{ {AFX MSG (CI2CDιalog) virtual BOOL OnlnitDialog 0 ; afx_msg void OnTimerfUINT nlDEvent) ; afx_msg void OnCloseO, //}}AFX_MSG DECLARE_MESSAGE_MAP ( ) ) ,
II { {AFX_INSERT_LOCATION} }
// Microsoft Developer Studio will insert additional declarations immediately before the previous line. ffendif // ' defined (AFX_I2CDIALOG_H BSD510ES_F7D5_11D2_96EE_00G097CDB9E2 INCLUDED
// I2CDialog . cpp : implementa on file //
((include "stdafx.h"
((include "sa.h"
((include " I2CDialog.h"
((include "DSP56kManager . h"
((define TIMERID 55 ffifdef _DEBUG ffdefine new DEBUG_NEW ffundef THIS_FILE static char THIS_FILE[] = FILE ; ffendif
///////////////////////////////////////////////////// ///////// '/////// '/UU 'III 1/ CI2CDialog dialog
CI2CDialog: :CI2CDialo (CWnd* pParent /*=NULL*/) : CDialog (CI2CDialog : :IDD, pParent)
{
//{{AFX_DATA_INIT(CI2CDialog)
// NOTE: the ClassWizard will add member initialization here //} }AFX_DATA_INIT
void CI2CDialog: : DoDataExchange (CDataExchange* pDX)
{
CDialog: : DoDataExchange (pDX) ;
//{ (AFX_DATA_MAP(CI2CDialog)
// NOTE: the ClassWizard will add DDX and DDV calls here
/ / } } AFX_DATA_MAP }
BEGIN_MESSAGE_MAP(CI2CDialog, CDialog)
//{ {AFX_MSG_MAP(CI2CDialog)
ON_WM_TIMER ( )
ON_WM_CLOSE()
//)}AFX_MSG_MAP END_MESSAGE_MAP ()
///////// //uui/iu//////////////////// ///////////////////// I//IUIU ii inn
II CI2CDialog mesεage handlers
BOOL CI2CDialog: : OnlnitDialo ()
{
CDialog: : OnlnitDialog 0 ;
// TODO: Add extra initialization here g_DSPManager = new CDSP56kManager (this- m_hWnd) ,- m_timerID = 0; m_timerID = SetTimer (TIMERID, 50, NULL) ; m_state = 0; return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pageε should return FALSE } void CI2CDialog: :OnTimer (UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default if( nIDEvent == TIMERID ) { if( g_DSPManager->IεReady () ) {
Bwitch( m state ) { case 0 g_DSPManager >DownloadDSPCode ( ) m_state++ break, caεe 1 g_DSPManager >ResetAll()
EndDιalog(IDOK) break, default
EndDιalog(IDOK) , break }
} else ιf( g_DSPManager >GetHDCDMode ( ) < 0 ) EndDialo ( IDABORT) ,
) else
{
CDialog OnTi er (nIDEvent) ,
BOOL CI2CDιalog OnCmdMsg(UINT nlD. int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerlnfo)
{
// TODO Add your specialized code here and/or call the base class return CDialog OnCmdMsg(nID, nCode, pExtra, pHandlerlnfo) , } void CI2CDιalog OnCloseO
{
// TODO Add your message handler code here and/or call default i ( m_tιmerID )
KιllTιmer( m_tιmerID )
CDialog OnClose 0 }
(fl 'defined (AFX_I2CC0MMERR0RDIALOG_H 76C389ES_FB89_11D2_96EE_006097CDB9E2 INCLUDED_)
((define AFX_I2CC0MMERR0RDIALOG_H 7GC389E8_F889__11D2_96EE_006097CDB9E2 INCLUDED_
Slf _MSC VER >= 1000
((pragma once fjendif // _MSC_VER >= 1000
// I2CCommErrorDιalog h header file
// II CI2CCommErrorDιalog dialog class CI2CComrαErrorDιalog public CDialog
(
// Construction public
CI2CComra£rrorDιalog(CWnd* pParent = NULL) // standard constructor
// Dialog Data
//{{AFX_DATA(CI2CCommErrorDιalog) enum { IDD = IDD_DIAL0G4 } CString m_ErrorCode //}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{ {AFX_VIRTUAL(CI2CCommErrorDialog) protected virtual void DoDataExchange (CDataExchange* pDX) // DDX/DDV support
//} }AFX_VIRTUAi
// Implementation protected
// Generated message map functions //{ {AFX_MSG (CI2CCommErrorDιalog) afx_msg void OnButtonlO, //}}AFX_MSG DECLARE_MESSAGE_MAP ( ) }
//{ (AFX_INSERT_LOCATION)}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line fendif // i defined (AFX_I2CC0MMERR0RDIAL0G_H 76C389E8_F889_11D2_96EE_006097CDB9E2 INCLUDED_)
// I2CCOm.-nErrorDialog . cpp : implementat ion f i le //
(( include " εtdafx . h"
((include " sa . h"
(( include " I2CCommErrorDialog . h" tf i fdef _DEBUG ((def ine new DEBUG_NEW ffundef THIS_FILE
Static char THIS_FILE [] = FILE ;
(f endi f i /uu iimiii ui iiiiiui mi ui mm i miiiiimiiimiuiiumi
II CI2CCommErrorDialog dialog
CI2CCommErrorDialog: :CI2CCommErrorDialog (CWnd* pParent /*=NULL*/) : CDialo (CI2CCommErrorDialog :: IDD, pParent)
{
//{{AFX_DATA_INIT(CI2CCommErrorDialog) m_ErrorCode = _T ( "" ) ; // } }AFX_DATA_INIT
void CI2CCommErrorDialog: : DoDataExchange (CDataExchange* pDX)
{
CDialog: : DoDataExchange (pDX) ;
//{{AFX_DATA_MAP(CI2CCommErrorDialog)
DDX_Text (pDX, IDC_EDIT1, m SrrorCode) ;
//} }AFX_DATA_MAP }
BEGIN_MESSAGE_MAP(CI2CCommErrorDialog, CDialog)
// { {AFX_MSG_MAP (CI2CCommErrorDialog)
ON_BN_CLICKED(IDC_BUTT0N1 , OnButtonl)
//} }AEX_MSG_MAP END_MESSAGE_MAP ( )
////// /////////////uu/uuiu/uuiuu/iiiii/u mi uu/ ii /in nun//////
II CI2CCommErrorDialog message handlers void CI2CCommErrorDialog: : OnButtonl ()
{
// TODO: Add your control notification handler code here EndDialog ( IDCANCEL) ;
)
// PEQParam.h: interface tor the CPEQParam class. // i miiiimum ii mmmuiiimiiiiiii miii/ui ui minimum ffif !defined(AFX_PEQPARAM_H 733FB7AB_4A49_11D3_96EE_OOG097CDB9E2 INCLUDED_)
((define AFX_PEQPARAM_H 733FB7AB_4A49_11D3_96EE_006097CDB9E2 I CLUDED_
((if _MSC_VER >= 1000
((pragma once
(fendif // _MSC_VER >= 1000 typedef struct _biquadcoef ( float c[G) ; // bo,bl,b2,aO,al,a2
) biquadcoef; class CPEQParam { float m_Gain; // in dB (+ or -) float m_Q; // in Q units float m_Frequency; // in Hz float m_SampleRate; // in Hz double m_pi; public: void GetCoef (biquadcoef *) ; void GetAllpassCoef (biquadcoef *) ; void SetQ( loat v) { m_Q = v; } void SetQ(CString tεtr) ; void SetGain! float v) { m_Gain = v; ) void SetGain (CString tstr) ; void SetFreq( float v) { m_Frequency = v; } void SetFreq (CString tstr) ,-
CPEQPara ( ) ; virtual -CPEQParam () ;
}; ffendif // Ide ined (AFX_PEQPARAM_H 733FB7AB_4A49_11D3_9GEE_006097CDB9E2 INCLUDED_)
// PEQParam cpp implementat ion of the CPEQParam class //
/////// /////////// mm i ui iiuii iiu/iuumuum uiimm mm
((include "εtdafx h"
((include "sa h"
((include "PEQParam h"
((include <stdιo h>
((include <math.h>
(fifdef _DEBUG #undef THIS_FILE static char THIS_FILE[)= FILE ,-
((define new DEBUG_NEW ffendif iimimnim tin ui mil mi iimmiiiuimii mil
II Construction/Destruction
CPEQParam: : CPEQParam!)
: m_Frequency (0.5) ,m_Gain(0.0) ,m_Q(1.0) , m_SampleRate (44100. )
{ m_pi = acos ( - 1. ) ;
}
CPEQParam: : -CPEQParam!) {
void CPEQParam: : SetGain (CString & str)
{ float V; εscanf (str, " %f " , &v) ; tn_Gain = v,- ) void CPEQParam: : SetFreq (CString & str) { float v ; sscanf (str, "%f ", iv) ; m_Frequency = v; } void CPEQParam: :SetQ (CString 6 str) { float v; εscaπf (str, "% ", &v) ; m_Q = v;
void CPEQParam: :GetAllpassCoe (biquadcoef *f) { double gamma, beta, wc, tbeta; double normFreq = m_Frequency/m_SampleRa e, wc = m_pi*normFreq; gamma = -cos(wc) ; tbeta = wc/(2*m_Q); ιf( tbeta > m_pi/4 ) tbeta = m_pi/4; beta = (1 -tan(tbeta) )/ (1. +tan ( tbeta) ) , f->c[0] = (float) beta; // bo f->c[l] = (float) (gamma* (1+beta) ) . // bl f->c|2] = 1 . // b2 f->c[3] = 1 , // a0 f->c[4] = f->c(l] , // al
£->c[S] = (float) beta, // a2
void CPEQParam GetCoef (biquadcoef *f)
double M,L, biquadcoef af, double gam = (float) po lO Gain/20
GetAllpasεCoe (εaf) , M = (1 -gain) /2 , L = (1 +gaιn)/2 , f->c[0] (float) (af c[0]*M+L) , // bO f->c[l] (float) (af c[l] *M+af .c[4) *L) , // bl f->c[2] (float) (af c[2)*M+af c[5)*L), // b2 f->c[3) af.c(3] f->c[4] af -c[4] f->c[5] af .c[5]
ff i f ! def ined (AFX_N0TCHPAGE2_H 5C8994C7_E2A4_11D2_9GEE_006097CDB9E2 INCLUDED_)
(fde f ine AFX_N0TCHPAGE2_H 5C899 C7_E2A4_11D2_96EE_006097CDB9E2 INCLUDED_
((if _MSC_VER > = 1000 ffpragma once ff endif // _MSC_VER > = 1000
// NotchPage2 . h : header f ile
// class CTabDialog ,- ii i iiiimiii iiiiiim mm ii iimiiiii
II CNotchPage2 dialog class CNotchPage2 : public CPropertyPage
!
DECLARE_DYNCREATE (CNotchPage2)
// Construction public:
CNotchPage2 () ;
-CNotchPage2 () ;
// Dialog Data
// { (AFX_DATA (CNotchPage2 ) enum { IDD = IDD_PP9 } ; CButton m_BypaεsSecondButton,- CButton m_BypassFirstButton; CSliderCtrl m_SliderCut4 ; CSliderCtrl m_SliderQ4; CSliderCtrl m_SliderFrequency4; CSliderCtrl m_SliderCut3 ; CSliderCtrl m_SliderQ3; CSliderCtrl m_SliderFrequency3 ,- //)}AFX_DATA
// Overrideε
// ClassWizard generate virtual function overrides
// { {AFX_VIRTUAL (CNotchPage2 ) protected: virtual void DoDataExchange (CDataExchange* pDX) ; // DDX/DDV support
// } }AFX_VIRTUAL
// Implementation protected:
// Generated message map functions
// { { AFX_MSG (CNotchPage2 ) afx_msg void OnPaint O ; virtual BOOL OnlnitDialog ( ) ; afx_mεg void OnVScroll (UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) ; afx_msg void OnBypassFirst ( ) ,- afx_msg void OnBypassSecond O ;
// } }AFX_MSG
DECLARE_MESSAGE_MAP ( )
CTabDialog *m_ParentWindow; void SendStringToUI ( int which) ,-
// { { AFX_INSERT_LOCATION} }
// Microsoft Developer Studio will insert additional declarations immediately before the previous line . ffendif // ! de ined (AFX_NOTCHPAGE2_H 5C8994C7_E2A4_llD2_96EE_O06097CDB9E2 INCLUDED_) // NotchPage2 cpp implementa ion file //
((include "stdafx h"
((include "sa h"
((include "NotchPage2 h"
((include "TabDialog h"
((include "DSP56kManager h" ffifdef _DEBUG #defιne new DEBUG_NEW (fundef THIS_FILE static char THIS_FILE[] = FILE , ffendif mum UIII ii mmmiiimmum II/IIII mil mil mil i
II CNotchPage2 property page IMPLEMENT_DYNCREATE(CNotchPage2, CPropertyPage)
CNotchPage2 CNotchPage2 () CPropertyPage (CNotchPage2 IDD)
{
//{ {AFX_DATA_INIT(CNotchPage2) //} }AFX_DATA_INIT )
CNotchPage2 ~CNotchPage2 ()
{
) void CNotchPage2 DoDataExchange (CDataExchange* pDX)
{
CPropertyPage. DoDataExchange (pDX) , //{ (AFX_DATA_MAP(CNotchPage2)
DDX_Control (pDX, IDC_CHECK6, m_BypassSecondButton) , DDX_Control(pDX, IDC_CHECK5, m_BypassFιrstButton) , DDX_Control(pDX, IDC_SLIDER6, m_SliderCut4) , DDX_Control(pDX, IDC_SLIDER5, m_SliderQ4 ) ; DDX_Control (pDX, IDC SLIDER4, m_SliderFrequency4) , DDX_Control(pDX, IDC_SLIDER3, m_SliderCut3) , DDX_Control(pDX, IDC_SLIDER2, m_SllderQ3); DDX_Control(pDX, IDC_SLIDER1, m_SlιderFrequency3) ; //} }AFX_DATA_MAP
BEGIN_MESSAGE_MAP (CNotchPage2 , CPropertyPage)
// { {AFX_MSG_MAP (CNotchPage2 )
ON_WM_PAINT( )
ON_WM_VSCROLL ( )
ON_BN_ CLICKED ( IDC_CHECK5 , OnBypassFirst)
ON_BN_CLICK£D ( IDC_CHECK6 , OnBypassSecond)
// } }AFX_MSG_MAP END_MESSAGE_MAP ( )
If
II CNotchPage2 message handlers void CNotchPage2 OnPaintO {
CPaintDC dc(thιs), // device context for painting
// TODO Add your message handler code here m_SlιderFrequency3 SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kNotchδFreq) ) , m_SlιderQ3 SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kNotchδQ) ) , m_SlιderCut3 SetPos (CONTROL_RANGE-g_DSPManager- >GetParamValue (kNotch6Cu ) ) m_SlιderFrequency4 SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kNotch7Freq) ) m_SlιderQ4 SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kNotch7Q) ) m_SlιderCu 4 SetPos (CONTROL_RANGE-g_DSPManager- >Get ParamValue (kNotch7Cu ) ) , m_BypassFιrstButton SetCheck (g_DSPManager- >GetBypasεSec ion (kBypaεsNotch3) ) . m_BypasεSecondButton SetCheck (g_DSPManager- >GetBypasεSect ion (kBypassNotch ) ) // Do not call CPropertyPage OnPaintO for painting messages }
BOOL CNotchPage2 OnlnitDialog () {
CPropertyPage OnlnitDialog 0
// 10DO Add extra initializa ion here m_ΞlιderFrequency3 SetRange (0 CONTROL_RANGE) , m_SlιderFrequency3 SetPos (CONTROL_RANGE-g_DSPManager >GetParamValue (kNotchGFreq) ) m_SlιderFrequency3 SetTicFre ( (CONTROL_RANGE+l) /16) , m_SlιderFrequency3 SetPageSize ( PG_CONTROL_AMT) m_SlιderQ3 SetRange (0 CONTROL_RANGE) m_SlιderQ3 SetPos (C0NTROL_RANGE g_DSPManager->GetParamValue (kNotch6Q) ) m_SlιderQ3 SetTicFreq! (CONTROL_RANGE+l) /16) , m_SlιderQ3 Se PageSize (PG_CONTROL_AMT) m_SlιderCut3 SetRange (0, CONTROL_RANGE) , m_SlιderCut3 Se Pos (CONTROL_RANGE g_DSPManager->GetParamValue (kNotchδCut) ) , m_SlιderCut3 SetTicFreqf (C0NTR0L_RANGE+1) /16) , m_SlιderCut3 SetPageSize (PG_CONTROL_AMT) , m_SlιderFrequency4 SetRange (0, CONTROL_RANGE) ; m_SlιderFrequency4 SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kNotch7Freq) ) , m_SlιderFrequency4 SetTicFreq! (CONTROL_RANGE+l) /16) , m_SlιderFrequency4 SetPageSize (PG_CONTROL_AMT) , m_SlιderQ4 SetRange (0,CONTROL_RANGE) , m_SlιderQ4 SetPos (CONTROL_RANGE-g_DΞPManager->GetParamValue (kNotch7Q) ) , m_SlιderQ4 SetTicFreq! (C0NTR0L_RANGE+1)/16) , m_SlιderQ4 SetPageSize (PG_CONTROL_AMT) , m_SlιderCut4 SetRange (0,CONTROL_RANGE) , m_SlιderCut4 SetPos (CONTROL_RANGE g_DSPManager->GetParamValue (kNotch7Cut) ) , m_SlιderCut4 SetTicFreq ( (CONTROL_RANGE+l) /16) , m_SlιderCut4 SetPageSize (PG_CONTROL_AMT) , m_ParentWmdow = (CTabDialog *) GetParent 0 ->GetParent () , return TRUE, // return TRUE unless you set the focus to a control // EXCEPTION OCX Property Pages should return FALSE } void CNotchPage2 OnVScroll (UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) {
// TODO Add your message handler code here and/or call default
CSliderCtrl *slιder = (CSliderCtrl pScrollBar, int which,
CPropertyPage OnVScroll (nSBCode, nPos, pScrollBar),
Sleep(50) , ιf( slider == &m_SlιderFrequency3 ) which = kNotch6Freq else ιf( slider == s<m_SlιderQ3 ) which = kNotch6Q, else ιf( slider == &m_SlιderCut3 ) which = kNotch6Cut else if! εlider == &m_SlιderFrequency4 ) which = kNotch7Freq else ιf( slider == &m_SlιderQ4 ) which = kNotch7Q, else lf( slider == &m_SlιderCut4 ) which = kNotch7Cut else return g_DSPManager- >Set ParamValue (CONTROL_RANGE sl ιder- >GetPos ( ) . which) SendStringToUI (which) void CNotchPage2 -. SendStringToUI (int which) {
CString str; g_DSPManager- >GetSt ringValue (which , str ) m_ParentWmdow- >SetStatusS ring ( 0 , str) ;
void CNotchPage2 : OnBypassFirst ( )
{
// TODO: Add your control notification handler code here int state = m_BypassFιrstButton.GetState () s. 0x3; g_DSPManager->SetBypassSect ion (state, kBypassNotch3) ,-
void CNotchPage2 : :OnBypassSecond()
{
// TODO: Add your control notification handler code here int state = m_BypassSecondButton.GetState() & 0x3; g_DSPManager->SetBypassSection(state,kBypassNotch4) ,-
(flf ' defined (AFX_N0TCHPAGE1_H 0CF7E208_D790_11 D2_9GEE_O0G097CDB9E2 INCLUDED_)
((define AFX_NOTCHPAGEl_H 0CF7E208_D790_11D2_9GEE_006097CDB9E2 INCLUDED_
(f lf _MSC_VER >= 1000
((pragma once ffendi f // _MSC_VER >= 1000
// NotchPagel h header f i le
// ii nun mm ii ui IIIII I/III ii mini mmmiiiiimiiii
II CNotchPagel dialog class CTabDialog, class CNotchPagel public CPropertyPage
{
DECLARE_DYNCREATE (CNotchPage1 )
// Construction public:
CNotchPagel () ;
-CNotchPagel () ;
// Dialog Data
//{ {AFX_DATA (CNotchPagel) enum { IDD = IDD_PP4 } ; CButton m_BypassSecondButton; CButton m_BypassFirstButton, CSliderCtrl m_SliderCut2; CSliderCtrl m_SliderQ2; CSliderCtrl m_SliderFrequency2; CSliderCtrl m_ΞliderCutl ; CSliderCtrl m_SliderQl, CSliderCtrl m_SliderFrequency1 ; //}}AFX_DATA
// Overrides
// ClasεWizard generate virtual function overrides
//{ {AFX_VIRTUA (CNotchPagel) protected: virtual void DoDataExchange (CDataExchange* pDX) ; // DDX/DDV support
//)}AFX_VIRTUAL
// Implementation protected:
// Generated message map functions
//{ {AFX_MSG (CNotchPagel) virtual BOOL OnlnitDialog () ; afx_msg void OnVScroll (UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); afx_msg void OnShowWindow (BOOL bShow, UINT nStatus) ; afx_msg void OnPain () ; afx_msg void OnBypaεεFirεt () ; afx_mεg void OnBypassSecondO ;
//}}AFX_MSG
DECLARE_MESSAGE__MAP ( )
CTabDialog *m_ParentWindow; void SendStringToUI (int which) ;
}.
// { {AFX_INSERT_LOCATION} }
// Microsoft Developer Studio will insert additional declarations immediately before the previous line ffendif // 'de£med(AFX NOTCHPAGEl H OCF7E208_D790_11D2_96EE_006097CDB9E2 INCLUDED_) 123
// NotchPagel cpp implementation file //
((include "stdafx h' ((include "sa h" ((include "NotchPagel h" ((include "TabDialog h" ((include "DSP5GkManager h" tfifdef _DEBUG ((define new DEBUG_NEW ffundef THIS_FILE static char THIS_FILE[) = FILE ffendif ii imiiiiimu mi// iiimiuim illinium ii ii ui /mm ui
II CNotchPagel property page
IMPLEMENT_DYNCREATE(CNotchPagel, CPropertyPage)
CNotchPagel CNotchPagel () CPropertyPage (CNotchPagel IDD) {
//{ {AFX_DATA_INIT(CNotchPagel)
//) }AFX_DATA_INIT
CNotchPagel -CNotchPagel ()
{
} void CNotchPagel DoDataExchange (CDataExchange* pDX)
{
CPropertyPage DoData Exchange (pDX) , //{ {AFX_DATA_MAP (CNotchPagel) DDX_Control (pDX, IDC_ CHECK6, m_BypassSecondButton) DDX_Control (pDX, IDC_ CHECKS, m_BypassFιrstButton) , DDX_Control (pDX, IDC_ SLIDERG, m_SlιderCut2) DDX_Control (pDX, IDC_ SLIDERS, m_SlιderQ2) , DDX_Control (pDX, IDC_ SLIDER4, m_SlιderFrequency2) DDX_Control(pDX, IDC_ SLIDER3, m_SlιderCutl) , DDX_Control(pDX, IDC_ SLIDER2, m_SlιderQl), DDX_Control(pDX, IDC_ SLIDER1, m SliderFrequencyl), //} }AFX_DATA_MAP
BEGIN_MESSAGE_MAP (CNotchPagel , CPropertyPage)
//{ {AFX_MSG_MAP (CNotchPagel)
ON_WM_VSCROL ( )
ON_WM_SHOW INDOW ( )
ON_WM_PAINT O
ON_BN_CLICKED ( IDC_CHECK5 , OnBypassFirst )
ON_BN_CLICKED ( IDC_CHECK6 , OnBypasεSecond)
/ / } ) AFX_MSG_MAP END_MESSAGE_MAP ( ) ii i in inn ii in in ii mimmiii
II CNotchPagel message handlers
BOOL CNotchPagel OnlnitDialog () {
CPropertyPage OnlnitDialog () ,
// TODO Add extra initialization here m_SlιderFrequencyl SetRange (0, CONTROL_RANGE) , m_SlιderFrequencyl SetPos (CONTROL_RANGE g_DSPManager >GetParamValue (kNotchlFreq) ) m_SlιderFrequencyl SetTicFreq ( (C0NTR0L_RANGE+1) /16) m_SlιderFrequencyl SetPageSize (PG_CONTROL_AMT) m_SlιderQl SetRange (0, CONTROL_RANGE) m_SlιderQl SetPos (CONTROL_RANGE-g_DSPManager >Get ParamValue (kNotchlQ) ) m_SlιderQl SetTicFreq ( (C0NTROL_RANGE+l) /IG) m_SlιderQl Set PageSize ( PG_CONTROL_AMT) , m_SlιderCutl SetRange (0, CONTROL_RANGE) , m_SlιderCutl SetPos (CONTROL_RANGE-g_DSPManager- >Get ParamValue (kNotchlCut ) ) , m_ΞlιderCutl SetTicFreq ( (CONTROL_RANGE+l ) /16) , m_SlιderCutl SetPageSize (PG_CONTROL_AMT) , m_SlιderFrequency2 SetRange (0, CONTROL_RANGE) , m_SlιderFrequency2 SetPos (CONTROL_RANGE-g_DSPManager- >GetParamValue (kNotch2Freq) ) m_SlιderFrequency2 SetTicFreq ( (CONTROL_RANGE+l) /IG) , m_SlιderFrequency2 SetPageSize (PG_CONTROL_AMT) , m_SlιderQ2 SetRange ( 0. CONTROL_RANGE) , m_SlιderQ2 SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kNotch2Q) ) , m_SlιderQ2 SetTicFreq ( (CONTROL_RANGE+l) /16) , m_SlιderQ2 SetPageSize (PG_CONTROL_AMT) , m_SlιderCut2 SetRange (0, CONTROL_RANGE) , m_SlιderCut2 SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kNotch2Cut) ) , m_SlιderCut2 SetTicFreq ( (C0NTR0L_RANGE+1) /16) , m_SlιderCut2 SetPageSize (PG_CONTROL_AMT) ; m_ParentWmdow = (CTabDialog *) GetParent () ->GetParent ( ) , return TRUE, // return TRUE unless you set the focuε to a control // EXCEPTION OCX Property Pages should return FALSE } void CNotchPagel OnVScroll (UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO Add your meεεage handler code here and/or call default CSliderCtrl *εlιder = (CSliderCtrl *) pScrollBar; int which,
CPropertyPage OnVScroll (nSBCode, nPos, pScrollBar) ;
Sleep(SO) , if! slider == tm SliderFrequencyl ) which = kNotchlFreq, else ιf( slider == S,m_SlιderQl ) which = kNotchlQ; elεe if( slider == &m_SliderCutl ) which = kNotchlCu ,- else if! slider == &m_SlιderFrequency2 ) which = kNotch2Freq, else if! slider == &m_SliderQ2 ) which = kNotch2Q, else ιf( slider == &m_SlιderCut2 ) which = kNotch2Cut, elεe return, g_DSPManager->SetParamValue (CONTROL_RANGE- slider- >GetPos 0.which) , SendStringToUI (which) ,
void CNotchPagel OnShowWindo (BOOL bShow, UINT nStatus) {
CPropertyPage OnShowWindow (bShow, nStatus);
// TODO Add your message handler code here
void CNotchPagel OnPaintO (
CPaintDC dc(thιs), // device context for painting
// TODO Add your message handler code here m_SlιderFrequencyl SetPos (CONTR0L_RANGE-g_DSPManager->GetParamValue (kNotchlFreq) ) m_SlιderQl Set Pos (CONTROL_RANGE-g_DSPManager->GetParamValue (kNotchlQ) ) , m_SlιderCu l Se Pos (CONTROL_RANGE-g_DSPManager->Get ParamValue (kNotchlCut) ) , m_SlιderFrequenc 2 SetPos (cONTROL_RANGE-g_DSPManager->Get ParamValue (kNotch2Freq) ) m_SlιderQ2 SetPos (CONTROL_RANGE-g_DSPManager- -.Get ParamValue (kNotch2Q) ) , m_SlιderCut2 SetPos (CONTROL_RANGE-g_DSPManager- >GetParamValue (kNotch2Cu ) ) , m_BypassFιrεtButton SetChec (g_DSPManager- >GetBypassSect ion (kBypassNotchl) ) , m_BypassSecondButton SetCheck (g_DSPManager->GetBypassSec ion (kBypassNotch2) ) ,
// Do not call CPropertyPage OnPaintO for painting messages ) void CNotchPagel- SendStringToUI ( int which)
!
CString str, g_DSPManager- >GetStrιngValue (which , str) , m_ParentWιndow- >SetSlatusS nng ( 0 , str) ,
J void CNotchPagel OnBypassFirst ( )
{
// TODO: Add your control notification handler code here int state = m_BypassFιrstButton.GetState () & 0x3; g_DSPManager->SetBypassSec ιon (s ate, kBypassNotchl) ;
void CNotchPagel: :OnBypassSecond ()
{
// TODO: Add your control notification handler code here int state = m_BypassSecondButton.GetState () & 0x3; g_DSPManager->SetBypassSectιon(state,kBypasεNotch2) ;
ffif 'defined (AFX_NEWCUTOFFPAGE_H E2728226_E02G_11D2_96EE_00G097CDB9E2 INCLUDED_)
((define AFX_NEWCUTOFFPAGE_H E2728226_E02G_11D2_96EE_006097CDB9E2 INCLUDED_ ffif _MSC_VER >= 1000
((pragma once ffendif // _MSC_VER >= 1000
// NewCutof f Page h header file
// class CTabDialog ii ii ii ui ii iiuiiiiiiiiiimimmii/muimiiiiimmi iiimim
II CNewCutof Page dialog class CNewCuto Page public CPropertyPage
{
DECLARE_DYNCREATE (CNewCutoffPage)
// Construction public
CNewCutoffPageO ,
-CNewCutoffPage () ,
// Dialog Data
//{ {AFX_DATA (CNewCutoffPage) enum { IDD = IDD_PP8 } , CButton m_BypassNLopassButton, CSliderCtrl m_NewHιQSlιder , CSliderCtrl m_NewHιFreqSlιder, CButton tn_BypaεsLopassButton, CButton m_BypassHιpaεsButton, CSliderCtrl m_HιQSlιder, CSliderCtrl m_HιFreqSlιder, CSliderCtrl m__LoQSlιder , CSliderCtrl m_LoFreqSlιder, //}}AFX_DATA
// Overrideε
// ClassWizard generate virtual function overrides
//{ {AFX_VIRTUAL (CNewCutoffPage) public virtual BOOL OnSetActive () , protected virtual void DoDataExchange (CDataExchange* pDX) , // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation protected
// Generated message map functions
// { (AFX_MSG (CNewCuto Page) afx_msg void OnVScroll (UINT nSBCode, UINT nPos, CScrollBar* pScrollBar), virtual BOOL OnlnitDialog () , afx_msg void OnShowWindow (BOOL bShow, UINT nStatus), afx_msg void OnPa tO, afx_msg void OnBypassHipass ( ) , afx_msg void OnBypassLopass () , afx_msg void OnBypassNewLopaεs () ,
//}}AFX_MSG
DECLARE_MESSAGE_MAP ( )
CTabDialog *m_ParentWιndow, void SendStringToUI (mt which),
).
//{ {AFX_INSERT_LOCATION} }
// Microεoft Developer Studio will insert additional declarations i mediately before the previous line ffendif // 'defined (AFX NEWCUTOFFPAGE H E272B226 E026 11D2_96EE_006097CDB9E2 INCLUDED_) // NewCutoffPage cpp implementa ion file //
((include "stdafx h'
((include "sa h"
((include "NewCutoffPage h"
((include "TabDialog h"
((include "DSPSGkManager h" fdfdef _DEBUG ((define new DEBUG_NEW (fundef THIS_FILE static char THIS_FILE[] - FILE ffendif III II CNewCutof Page property page
IMPLEMENT_DYNCREATE (CNewCutoffPage, CPropertyPage)
CNewCuto Page CNewCutof Page () CPropertyPage (CNewCutoffPage IDD)
{
// { {AFX_DATA_INIT (CNewCuto fPage)
// } }AFX_DATA_INIT }
CNewCutof Page -CNewCutoffPage O
void CNewCuto fPage DoDataExchange (CDataExchange* pDX)
{
CPropertyPage DoDataExchange (pDX) , //{ {AFX_DATA_MAP (CNewCutof Page)
DDX_Control (pDX, IDC_CHECK7, m_BypaεεNLopassButton) . DDX_Control (pDX, IDC_SLIDER9, m_NewHιQSlιder) , DDX_Control (pDX, IDC_SLIDER8, m_NewHιFreqSlιder) , DDX_Control (pDX, IDC_CHECK5, m_BypassLopassButton) , DDX_Control (pDX, IDC_CHECK4, m_BypaεsHιpassButton) DDX_Control (pDX, IDC_SLIDER5, m_HιQSlιder) , DDX_Control (pDX, IDC_SLIDER4, m_HιFreqSlιder) , DDX_Control (pDX, IDC_SLIDER2, m_LoQSlιder) , DDX_Control (pDX, IDC_SLIDER1, m_LoFreqSlιder) , // } }AFX_DATA_MAP
BEGIN_MESSAGE_MAP (CNewCutoffPage, CPropertyPage)
//{ {AFX_MSG_MAP (CNewCutoffPage)
ON_WM_VSCROLL ( )
ON_WM_SHOWWINDOW()
ON_WM_PAINT ( )
ON_BN_CLICKED ( IDC_CHECK4 , OnBypassHipass )
ON_BN_CLICKED ( IDC_CHECK5 , OnBypassLopass)
ON_BN_CLICKED ( IDC_CHECK7 , OnBypassNewLopass )
// } }AFX_MSG_MAP END_MESSAGE_MAP ( ) ιιuιιιιιmιιιιι/ιιιιuιιιιιιιιιιιιιιιιιιι/111111 ii iimiiiii imiiiiuimi
II CNewCutoffPage message handlers void CNewCutoffPage OnVScroll (UINT nSBCode UINT nPos CScrollBar* pScrollBar) {
// TODO Add your message handler code here and/or call default
CSliderCtrl 'slider = (CSliderCtrl *)pScrollBar int which
CPropertyPage OnVScroll (nSBCode nPos, pScrollBar)
Sleep(50) ιf( slider == &m_LoFreqSlιder ) which = kLoCutof Freq, elεe ιf( slider == im_LoQSlιder ) which = kLoCutoffQ, else ιf( slider == s.m_HιFreqSlιder ) which = kHiCuto Freq. else ιf( slider == Sm_HιQSlider ) which = kHiCutoffQ, else ιf( slider == tm_NewHιFreqSlιder ) which = kHiCutoff2Freq, else ιf( slider == £.m_NewHιQSlιder ) which = kHιCutoff2Q, else return, g_DSPManager->SetParamValue (CONTROL_RANGE-slιder- >GetPos ( ) , which) , SendStringToUI (which) ,
void CNewCutoffPage SendStringToUI ( t which)
CString str; g_DSPManager- >GetStringValue (which, εtr) ; m_ParentWindow->SetStatusString (0 , str) ;
BOOL CNewCutof Page : : OnlnitDialo ( )
{
CPropertyPage : : OnlnitDialog ! ) ;
// TODO- Add extra initialization here m_LoFreqSlider . SetRange (0 , CONTROL_RANGE) ; m_LoFreqSlider SetPos (CONTROL_RANGE-g_DSPManager- >GetParamValue (kLoCuto fFreq) ) , m_LoFreqSlider . SetTicFreq ( (CONTROL_RANGE+l) /IG) , m_LoFreqSlider SetPageSize (PG_CONTROL_AMT) ; m_LoQSlider. SetRange ( 0 , CONTROL_RANGE) ; m_LoQΞlider . SetPos (CONTROL_RANGE-g_DSPManager- >GetParamValue (kLoCutof fQ) ) ; m_LoQSlider. SetTicFreq ( (CONTROL_RANGE+l) /16) ; m_ LoQSl ider . Set PageSize ( PG_C0NTROL_AMT) ; m_HiFreqSlider. SetRange ( 0, CONTROL_RANGE) ; m_HiFreqSlider. SetPoε (CONTROL_RANGE-g_DSPManager- >GetParamValue (kHiCutof fFreq) ) ; m_HiFreqSlider . SetTicFreq ( ( CONTROL_RANGE+ 1 ) /16) ; m_HiFreqSlider SetPageSize (PG_CONTROL_AMT) ; m_HiQSlider . SetRange ( 0 , CONTROL_RANGE) ; m_HιQSlider . Set Pos (CONTROL_RANGE-g_DSPManager- >Get ParamValue (kHiCutoffQ) ) , m_HiQSlider . SetTicFreq ! (CONTROL_RANGE+l) /16) ; m_HiQSlider . SetPageSize (PG_CONTROL_AMT) ; m_NewHiFreqSlider SetRange ( 0 , C0NTROL_RANGE) ; m_NewHiFreqSlider SetPos (CONTROL_RANGE-g_DSPManager- >GetParamValue (kHiCutof f 2Freq) ) , m_NewHiFreqSlider SetTicFreq ! (CONTROL_RANGE+l) /16 ) , m_NewHιFreqSlιder SetPageSize (PG_CONTROL_AMT) . m_NewHιQΞlider . SetRange (0 , CONTROL_RANGE) , m_NewHιQSl ιder SetPos (CONTROL_RANGE-g_DSPManager- >Get ParamVa lue (kHiCutof 2Q) ) , m_NewHiQSlider SetTicFreq t (CONTROL_RANGE+l) /16) ; m_NewHιQSlider SetPageSize ( PG_CONTROL_AMT) , m_ParentWmdow = (CTabDialog * ) GetParent ( ) - Get Parent ( ) , return TRUE ; // return TRUE unless you set the focus to a control // EXCEPTION OCX Property Pages should return FALSE } void CNewCutof f Page OnShowWindow (BOOL bShow, UINT nStatus)
(
CPropertyPage OnShowWindow (bShow, nStatus ) , // TODO Add your message handler code here
}
BOOL CNewCutof fPage OnSetAc lve ( )
(
// TODO Add your specialized code here and/or call the base class return CProper yPage OnSetActiveO ) void CNewCuto Page OnPamtl)
(
CPaintDC dc(thιs) // device context for painting
// TODO Add your message handler code here m_LoFreqSlιder SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kLoCutoffFreq) ) m_LoQSlιder SetPos (CONTROL_RANGE-g_DSPManager- GetParamValue (kLoCuto Q) ) m_HιFreqSlιder SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kHiCutoffFreq) ) m_HιQSlιder SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kHiCuto fQ) ) m_NewHιFreqSlιder SetPos (CONTROL_RANGE g_DSPManager->GetParamValue (kHiCutoff2Freq) ) m_NewHιQSlιder SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kHiCutof 2Q) ) , ra_BypassHιpaεsButton SetCheck(g_DSPManager->GetBypassSectlon(kBypaεsHιpass) ) , m_BypassLopassButton SetCheck (g_DSPManager->GetBypassSectιon (kBypassLopasε) ) , m_BypassNLopassButton SetCheck (g_DSPManager->GetBypaεεSectιon (kBypassNLopass) ) , // Do not call CPropertyPage OnPain O for painting meεεages } void CNewCutoffPage OnBypasεHipass ()
{
// TODO Add your control notification handler code here t state = m_BypassHιpassButton GetStateO & 0x3, g_DSPManager >SetBypassSectιon (εtate kBypaεsHipasε) ,
} void CNewCutof Page OnBypassLopass ()
{
// TODO Add your control notification handler code here int state = m_BypassLopasεButton GetStateO & 0x3, g_DSPManager
Figure imgf000130_0001
(εtate, kBypassLopass) ,
void CNewCutoffPage OnBypaεεNewLopaεs ()
{
// TODO Add your control notification handler code here int state = m_BypassNLopassButton GetStateO & 0x3, g_DSPManager >SetBypaεsSectιon (state kBypasεNLopaεs) ,
// ShelfEQParam h interface for the CShel EQParam class // mil ui ti ii uu/ ui muiuiiu ii mm mm m
(flf 'defined (AFX_ShelfEQPARAM_H 733FB7AB_4A49_11D3_96EE_006097CDB9E2 INCLUDED_) ffdefine AFX_ShelfEQPARAM_H 733FB7AB_4A49_11D3_96EE_00G097CDB9E2 INCLUDED_ ff i f __MSC__VER >= 1000 ffpragma once ff endi f // _MSC_VER >= 1000 typedef struct _bιquadcoef { f loat c [ 6 ] , // b0. bl , b2 , a0 , al , a2
} biquadcoef ,- class CShelfEQParam { float m_Gain; // in dB (+ or -) float m_Frequency,- // in Hz float m_SampleRate; // in Hz double m_pi; bool m_HiShelf; public: void GetCoef (biquadcoef *) ; void GetAllpasεCoef (biquadcoef *); void SetGain (float v) { m_Gain = v; } void SetGain (CString &str) ,- void SetFreq(float v) { m_Frequency = v, } void SetFreq (CString tstr) ;
CShelfEQParam (bool hi) ; virtual -CShelfEQParamO ;
} ; ffendif // ! defined (AFX_ShelfEQPARAM_H 733FB7AB_4A49_11D3_96EE_006097CDB9E2 INCLUDED_)
1/11918
131
// ShelfEQParam cpp implementation of the CShelfEQParam class
// //////////////////////////////////////////////////////////////////////
((include "stdafx h" ((include "sa h" ((include "ShelfEQParam h" ((include stdιo h> ((include math h>
#ifdef _DEBUG ffundef TΗIS_FILE static char THIS_FILE[)= FILE ,
((define new DEBUG_NEW ffendif mil II II Construction/Destruction
CShelfEQParam: :CShelfEQParam(bool hi)
: m_Frequency(0.5) ,m_Gain(0.0) , m_SampleRate (44100. ) , m HiShelf (hi)
( m_pi = acos (-1. ) ;
)
CShelfEQParam: : -CShelfEQParam () {
} void CShelfEQParam: : SetGain (CString & εtr)
{ float v; εscanf (str, "%f " , &v) ; m_Gain = v; } void CShelfEQParam: : SetFreq (CString & str) { float v; εscanf (str, "%f", &v) ; m_Frequency = v; } void CShelfEQParam: :GetAllpaεεCoe (biquadcoef *f) { double gamma, c; double normFreq = m_Frequency/m_SampleRate/2 ; wc = m_pi*normFreq; gamma = (tan (wc/2) -1) / (tan (wc/2) +1) ; if( m_HiShelf )
{ f->c[0] = (float) gamma; // bO f->c[l) = 1 0; // bl
} elεe
{ f-?c[0] = (float) -gamma, // bO f->c(l] = -1 0, // bl } f->c[2] = 0, // b2 f->c[3] = 1 ; // a O f->c(4) = (float) gamma. // a l f->c[5] = 0, // a2
) void CShelfEQParam GetCoef (biquadcoef *f) ( double M, L biquadcoef af, double gain = (float) pow(10 ,m_Gaιn/20 ),
GetAllpassCoef (ia ) , M = (1 -gaιn)/2 , L = (1 +gaιn)/2 , f->c[0] = (float) (af c[0]*M+L) , // bO f->c[l] = (float) (af c[l] *M+af c[4] *L) // bl f- c[2] = (float) (af c[2] *M+af c[5] *L) , // b2 f->c(3] = af c[3] , f->c[4) = af c[4] , f->c[5] = af c[5] ,
// saDlg h header file //
((if ' defined (AFX_SADLG_H 33D93BOB_DOB8_11D2_9GEE_006097CDB9E2 INCLUDED^)
((define AFX_SADLG_H 33D9 B0B_D0B8_llD2_9GEE_O0G097CDB9E2 INCLUDED_
Figure imgf000134_0001
- 1000
II III III II I II Ulll II IIIIUII/IIII/II III II
II CSaDlg dialog class CSaDlg public CDialog
(
// Construction public
CSaDl (CWnd* pParent = NULL), // standard constructor
// Dialog Data
//{ { AFX_DATA (CSaDlg) enum { IDD = IDD_SA_DIALOG ) ,
// NOTE the ClassWizard will add data members here //}}AFX_DATA
// ClassWizard generated virtual function overrides
// ( {AFX_VIRTUAL (CSaDlg) protected virtual void DoDataExchange (CDataExchange* pDX) , // DDX/DDV support
//)}AFX_VIRTUAL
// Implementation protected
HICON m_hIcon,
// Generated mesεage map functions //{ {AFX_MSG(CSaDlg) virtual BOOL OnlnitDialog!), afx_msg void OnSysCommandlUINT nlD, LPARAM lParam) afx_msg void OnPamtO, afx_msg HCURSOR OnQueryDraglcon () , afx_mεg void OnButtonlf), afx_msg void OnButton2 () , //}]AFX_MSG DECLARE_MESSAGE_MAP ( ) }.
//{ {AFX_INSERT_LOCATION} )
// Microsoft Developer Studio will insert additional declarations immediately before the previous line
(fendif // ' defined (AFX_SADLG_H 33D93B0B_DOB8_llD2_96EE_O0G097CDB9E2 INCLUDED^)
11918
134
// saDlg cpp implementation file //
((include "stdafx h" ((include "sa h" ((include "saDlg h"
((include "umt_ppι h" ((include "functs h" ((include "TabDialog h" ffifdef _DEBUG ((define new DEBUG_NEW (fundef THIS_FILE static char THIS_FILE(] = FILE , ffendif
εtatic t cmd_delay = 1000 , stat ic int ιo_delay = 50 , mmmuiiiii ii ilium in m a in/mil ui ii
U CAboutDlg dialog used for App About class CAboutDlg : public CDialog
{ public:
CAboutDlg ;
// Dialog Data
//{ {AFX_DATA (CAboutDlg) enum { IDD = IDD_ABOUTBOX } ; //}}AFX_DATA
// ClasεWizard generated virtual function overrides
//{ {AFX_VIRTUAL (CAboutDlg) protected: virtual void DoDataExchange (CDataExchange* pDX) ; // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation protected-
//{ {AFX_MSσ (CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE MAP ()
CAboutDlg: :CAboutDlg () - CDialog (CAboutDlg :: IDD)
//{ {AFX_DATA_INI (CAboutDlg) //} }AFX_DATA_INIT
void CAboutDlg DoDataExchange (CDataExchange* pDX)
CDialog DoDataExchange (pDX) , //{ {AFX_DATA_MAP (CAboutDlg) // j }AFX_DATA_MAP
BEGIN_MESSAGE_MAP (CAboutDlg, CDialog)
// { {AFX_MSG_MAP (CAbou Dlg) // No message handlers
//}}AFX_MSG_MAP END_MESSAGE_MAP ( ) u uui mum u mm mmuummii ii 11 ii in 11 ii i null mm i
II CSaDlg dialog
CSaDlg CSaDlg (CWnd* pParent /*=NULL*/) CDialo (CSaDlg IDD, pParent) //{ {AFX_DA1A_INIT (CSaDlg)
// NOTE the ClassWizard will add membei ini ialization here //} )λIrX_DATA 1NIT
// Note that Loadlcon does not require a subsequent Destroylcon in Win32 m_hIcon = AfxGetApp () - >LoadIcon ( 1DR_ AI FRAME) } void CSaDlg DoDataExchange (CDa aExchange* pDX) {
CDialog DoDataExchange (pDX)
//{ (AFX_DATA_MAP(CSaDlg)
// NOTE the ClassWizard will add DDX and DDV calls here
//} )AFX_DATA_MAP }
Figure imgf000136_0001
π i ui ui ui nun in iiiiiiiumiiiuii/uiitiiuiiuiiiuiiiiiiiiitiimni
II CSaDlg message handlers
BOOL CSaDlg- Onlni Dialog 0
{
CDialog OnlnitDialog () ,
// Add "About " menu item to system menu
// IDM_ABOUTBOX must be in the system command range. ASSERT( (IDM_ABOUTBOX t OxFFFO) == IDM_ABOUTBOX) , ASSERT(IDM_ABOUTBOX < OxFOOO),
CMenu* pSysMenu = GetSystemMenu(FALSE) if (pSysMenu != NULL)
{
CString strAboutMenu, strAboutMenu Loadstrmg (IDS_ABOUTBOX) , if ( i StrAboutMenu IεEmptyO)
{ pSysMenu->AppendMenu (MF_SEPARATOR) , pSysMenu->AppendWenu(MF_STRING, IDN_ABOUTBOX, strAboutMenu), } }
// Set the icon for this dialog The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE), // Set big icon SetIcon(m_hIcon, FALSE), // Set small icon ere the system directory Fix this and restart application I
Figure imgf000136_0002
8et_ιo_delay_cnt_value ( ι _delay) return TRUE, // return TRUE unless you set the focus to a control
) void CSaDlg OnSysCommand (UINT nlD LPARAM 1 Param)
( if ( (nlD J, OxFFFO) =- IDM ABOUTBOX) {
CAboutDlg dlgAbout, dlgAbout DoModalO,
} else
{
CDialog - OnSysCommand (nlD , 1 Param) ,
) }
// If you add a minimize button to your dialog, you will need the code below // to draw the icon For MFC applications using the document/view model, // this is automatically done for you by the framewoik void CSaDlg OnPamt ()
( if (Iεlcσnic 0 )
{
CPaintDC dc(thιs); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSa eHdc ( ) , 0) ;
// Center icon in client rectangle int cxlcon = GetSystemMetrics (SM_CXICON) ; int cylcon = GetSyεtemMetrics (SM_CYICON) ;
CRect rect;
GetClientRect (trect) ; int x = (rect . Width O - cxlcon + 1) / 2 ; int y = (rect .Height 0 - cylcon + 1) / 2 ;
// Draw the icon dc . DrawIcon (x, y, m_hIcon) ,-
} elεe
{
CDialog - : OnPaint ( ) ;
} )
// The system calls this to obtain the cursor to display while the user drags // the minimized window. HCURSOR CSaDlg: :OnQueryDragIcon ( )
{ return (HCURSOR) m_hIcon;
} void CSaDlg: : OnButtonl () { long tlong; tlong=spi_xchng24 (0XAA55AA) ,- tlong=εpi_xchng2 (0x0) ;
void CSaDlg..OnButton2 ()
{
// long tlong;
//
// tlong=εpi_xchng24 (0x654321) ;
// tlong=εpi_xchng24 (0x0) ,
CTabDialog dig; dig DoModal () ;
) // sa h mam header file for the SA application // ffif ' defined (AFX_SA_H 33D93B09_DOB8__11D2_96EE_OOS097CDB9E2 INCLUDED^)
((define AFX_SA_H 33D93B09_DOB8_11D2_96EE_006097CDB9E2 INCLUDED_
((if _MSC_VER >= 1000
((pragma once ffendif // _MSC_VER >= 1000 ffifndef AFXWIN_H
((error include stdafx h' before including this file for PCH ffendif
((include 'resource h" // main svmbols III Ulll II III II II I Ulll
II CSaApp
// See sa cpp for the implementation of this class
// class CSaApp public CWinApp
{ public
CSaApp () ,
// Overrides
// ClassWizard generated virtual function overrides
// ( {AFX_VIRTUAL (CSaApp) public virtual BOOL Imtlnstance O ,
//} )AFX_VIRTUAL
// Implementation
//{ {AFX_MSG (CSaApp)
// NOTE - the ClassWizard will add and remove member functions here
// DO NOT EDIT what you see in these blocks of generated code ' //)}AFX_MSG DECLARE_MESSAGE_MAP ( ) }. in ui ii ii i in in uu ui i in i mm i in nun ilium ii ii in ii ii ui miiuiii
II { {AFX_INSERT_LOCATION} }
// Microsoft Developer Studio will insert additional declarations immediately before the previous line ffendif // 'defined (AFX_SA_H 33D93B09 D0B8 11D2 9GEE 00G097CDB9E2 INCLUDED_)
// sa cpp Defines the class behaviors for the application //
((include "stdafx h" ((include "sa h" ((include "saDlg h" ((include "TabDialog h" ((include "I2CDιalog h" ((include "DSP56kManager h '
CDSPSGkManager *g_DSPManager , fflfdef _DEBUG ffdefme new DEBUG_NEW ffundef THIS_FILE static char THIS_FILE[] = FILE ffendif minimum mil/mill /illinium
II CSaApp
BEGIN_MESSAGE_MAP (CSaApp, CWinApp) // { {AFX_MSG_MAP (CSaApp)
// NOTE - the ClassWizard will add and remove mapping macros here // DO NOT EDIT what you see in these blocks of generated code' //)}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp -OnHelp) END_MESSAGE_MAP ( ) iiiiiuiii imiiumiimiuium mini iiii imm urn uiiiiiiuiuun v
// CSaApp construction
CSaApp CSaAp ( )
{
// TODO add construction code here,
// Place all significant initialization in Imtlnstance ) II I Ulll l/ll/ll/UUIIIUIIIII III flllll III I II The one and only CSaApp ob3 ect
CSaApp theApp,
//I//////////////////////////////////////////////////////////////////////////
1/ CSaApp initialization
BOOL CSaApp Imtlnstance ( ) {
AfxEnableControlContamer () ,
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need fflfdef _AFXDLL
Enable3dControls () // Call this when using MFC in a εhared DLL ffelse
Enable3dControlεStatιc() , // Call this when linking to MFC εtatically ffendif
// Set dialog background color to black // SetDialogBkColor (RGB(0 0 0) , RGB (255, 255, 255) ) , int response CI2CDιalog ldlg try { ιf( (response = ldlg DoModalO) '- IDOK ) { if( response == IDABORT )
{
Af MessageBox ( "Trouble initializing") ; Sleep(lOOO) ;
) // return FALSE;
}
) catch (CException* e )
{ // prin f ( "Trouble initializing\n") ; // Sleep(lOOO) ; return FALSE;
}
// CSaDlg dlg; CTabDialog dig; m_pMainWnd = Sdlg; int nReεponse = dlg.DoModal O ; if (nReεponεe == IDOK)
{
// TODO: Place code here to handle when the dialog is // dismissed with OK
} else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is // dismissed with Cancel
// Since the dialog has been closed, return FALSE so that we exit the // application, rather than εtart the application's message pump, return FALSE;
Figure imgf000141_0001
o o o o o o o o o o ιo uι ιιι oι n co
Figure imgf000141_0002
fi l f ' def ined (AFX_TABDIALOG_H SCB3 DF04_D20F_11D2_96EE_006097CDB9E2 INCLUDED_) ff def ine AFX_TABDIALOG_H 5CB3DF04_D20F_11D2_96EE_006097CDB9E2 INCLUDED_ ff i f _MSC_VER >= 1000
((pragma once
(f endif // _MSC_VER >= 1000
// TabDialog h header f i le
//
((include "Pagel h" ((include "Ma Page h" ((include "DDX h" ((include "NotchPagel h" ffinclude "NotchPage2 h" ffinclude "StWaveRe3 Page h" ((include "ShelvPage h" ((include "NewCuto fPage h" ((include "AllpasεPage h" ffinclude "DBNotch h" Ulll minium
II CTabDialog dialog
class CTabDialog : public CDialog
(
// Construction public: void DisplayI2CStatedong error) ,- virtual void SetStatusString ( t which, CString &s) ;
CTabDialog (CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{ {AFX_DATA (CTabDialog) enum { IDD = IDD_DIALOGl } ;
// NOTE: the ClaεsWizard will add data members here //}}AFX_DATA
// Overrides
// ClasεWizard generated virtual function overrides
//{ {AFX_VIRTUAL (CTabDialog) protected: virtual void DoDataExchange (CDataExchange* pDX) , // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation protected.- virtual void DisplayMode (int) ;
CStatuεBar m_StatusBar;
CPropertySheet m_dlgPropSheet ;
HICON m_hIcon; // CPagel m_Pagel;
CMainPage m_MainPage;
CDDX m_DDXPage ;
CNotchPagel m_NotchlPage;
CNotchPage2 m_Notch2Page;
CStWaveRejPage m_StWaveRe3Page,
CShelvPage m_ShelvPage; // CCutoffPage m_CutoffPage.- CNewCutoffPage m_CutoffPage;
CAllpassPage m_AllpassPage,
CDBNotch m_DBNotch,
CBrush m_brush,
UINT m_tιmerID;
BOOL m_HDCDDιsplay,
Figure imgf000142_0001
int m_ErrorCounter ,
// Generated mesεage map functions // ( (AFX_MSG (CTabDialog) virtual BOOL OnlnitDialog () , afx_msg void OnSyεCommand (UINT nlD, LPARAM 1 Param) afx_tnsg void OπPaintO, afx_msg HCURSOR OnQueryDraglcon ( ) , afx_msg void OnCloseO, afx_msg void OnMovednt x, int y) , afx_ιτsg HBRUSH OnCtlColor (CDC* pDC, CWnd* pWnd, UINT nCtlColor). afx_msg void OnOpenMenu () , afx_msg void OnSaveMenu () , afx_msg void OnTimer (UINT nIDEvent), afy_msg void OnFileExportparamflie ( )
//} }AFX_MSG
DECLARE MESSAGE MAPI)
//{ {AFX_INSERT_LOCATI0N} }
// Microsoft Developer Studio will insert additional declarations immediately before the previous line ffendif // 'defmedtAFX TABDIALOG H 5CB3DF04 D20F 11D2_9GEE 006097CDB9E2 INCLUDED )
143
// TabDialog cpp implementation file //
((include "stdafx h"
((include "sa h" ffinclude "TabDialog h"
((include "DSP56kManager h"
((include "I2CComm£rrorDιalog h"
((include ofxdlgs h> fflfdef _DEBUG
((define new DEBUG_NEW ftundef THIS_FILE static char THIS_FILE[] = FILE ffendif
ffdefine TIMERID 1
((define ID_HDCD_DETECT 5GO0O ffdefine ID ERROR DISPLAY (ID HDCD DETECT+1) static UINT auIDStatusBar [] { ID_SEPARATOR, ID_HDCD_DETECT, ID_SEPARATOR, ID_ERROR_DISPLAY
};
ffdefine AARRAYSIZE IG static char *Detect_Array [AARRAYSIZE] = {
" HDCD",
HDCD " HDCD
" HDCD
HDCD " HDCD " HDCD " HDCD " HDCD
HDCD " HDCD " HDCD "HDCD "DCD H" "CD HD" "D HDC"
);
It//// //////////////////////////////////////////////////////////
II CTabAboutDlg dialog used for App About class CTabAboutDlg • public CDialog
{ public:
CTabAboutDlg ()
II Dialog Data
//{ (AFX_DATA (CTabAboutDlg) enum { IDD = IDD_ABOUTBOX } ; //))AFX_DATA
// ClassWizard generated virtual function overrides
//( {AFX_VIRTUAL (CTabAboutDlg) protected virtual void DoDataExchange (CDataExchange* pDX) , // DDX/DDV support
//) }AFX_VIRTUAL
// Implementation protected -
//{ {AFX_MSG (CTabAboutDlg) //} )AFX_MSG DECLARE_MESSAGE_MAP ( )
CTabAboutDlg CTabAboutDlg ( ) CDialog (CTabAboutDlg IDD)
//{{AFX_DΛTA_INIT (CTabAboutDlg) //}}AFX DATA INIT
void CTabAboutDlg DoDataExchange (CDataExchange* pDX)
CDialog DoDataExchange (pDX) , //{ {AFX_DATA_MAP (CTabAboutDlg) //} }AFX DATA MAP
BEGIN_MESSAGE_MAP (CTabAboutDlg, CDialog)
//{ {AFX_MSG_MAP (CTabAboutDlg) // No message handlers
//}}AFX_MSG_MAP END_MESSAGE_MAP ( ) iitiiiiiiiiiiiiiium i iim i mm iiiiiiiim i mull iiiiiii i/ ///
II CTabDialog dialog
CTabDialog: :CTabDialo (CWnd* pParent /*=NULL*/) : CDialog (CTabDialog -IDD, pParent)
{
//{ {AFX_DATA_INIT(CTabDialog)
// NOTE the ClassWizard will add member initialization here //} }AFX_DATA_INIT m_hIcon = AfxGetApp () ->LoadIcon (IDR_MAINFRAME) ,
void CTabDialog: : DoDataExchange (CDataExchange* pDX)
{
CDialog: : DoDataExchange (pDX) ;
//{ {AFX_DATA_MAP (CTabDialog)
// NOTE: the ClassWizard will add DDX and DDV calls here
//} }AFX_DATA_MAP }
BEGIN_MESSAGE_MAP (CTabDialog, CDialog)
//{ {AFX_MSG_MAP (CTabDialog)
ON_WM_SYSCOMMAND ( )
ON_WM_PAINT ( )
ON_WM_QUERYDRAGICON ( )
ON_WM_CLOSE ( )
ON_WM_MOVE ()
0N_WM_CTTLC0LOR ( )
ON_COMMAND(ID_MENUITEM32771, OnOpenMenu)
ON_COMMAND(ID_MENUITEM32772, OnSaveMenu)
ON_WM_TIMER ( )
ON_COMMAND(ID_FILE_EXPORTPARAMFILE, OnFileExportparamfile)
//}}AFX_MSG_MAP END_MESSAGE_MAP ( ) ii iiiiiuimiiiiiimiiiuimi ii immiuiiii
II CTabDialog message handlers ffdefine PS_WIDTH 222 ((define PS_HEIGHT 215
BOOL CTabDialog OnlnitDialog { int partsListt) = ( 50, 100, 150, -l}. CDialog - -OnlnitDialog () ,
// Add "About " menu item to system menu
// IDM_ABOUTBOX must be in Che system command range ASSERT! (IDM_ABOUTBOX δ. 0XFFF0) == IDM_ABOUTBOX) . ASSER (IDM ABOUTBOX -; OxFOOO) ,
CMenu* pSysMenu = GetSystetnMenu ( FALSE) , if (pSysMenu '= NULL)
(
CString strAboutMenu, strAboutMeπu .LoadstrmgdDS_ABOUTBOX) , if ('strAboutMenu IsEmptyD)
{ pSysMenu->AppendMenυ (MF_SEPARATOR) ,- pSysMenu->AppendMenu (MF_STRING, IDM_ABOUTBOX, strAboutMenu), ) }
// Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog Setlcon(m_hlcon, TRUE) // Set big icon Setlcon(m_hlcon, FALSE); // Set small icon
// build brush m_brush.CreateSolιdBrush (RGB (0,0,0) ) ,
// build prop sheet m_dlgPropSheet AddPage (&m_MainPage) , m_dlgPropSheet AddPage (&m_DDXPage) ; m_dlgPropSheet AddPage (sm ShelvPage) ; m_dlgPropSheet .AddPage (&m_CutoffPage) ; m_dlgPropSheet .AddPage (&m_NotchlPage) , m_dlgPropSheet AddPage (&m_Notch2Page) ; m_dlgPropSheet AddPage (E.m_StWaveRej Page) , m_dlgPropSheet AddPage (&m_AllpassPage) ; m_dlgPropSheet AddPage (&m_DBtfotch) ; m_dlgPropSheet Create (this, WS_CHILD | WS VISIBLE, 0) ; m_dlgProρSheet .ModifyStyleEx( 0, HS_EX_CONTROLPARENT) ; m_dlgPropSheet.ModifyStyle(0, WS_TABSTOP) ; m_dlgPropSheet.SetWindowPos(NULL, 0, 0, PS_WIDTH, PS_HEIGHT. SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE ),
// resize dialog to fit propεheet exactly RECT rect; m_dlgPropSheet .GetWindowRect (irect) ; //rect .bottom += 14; //rect. ight += 14; SetWindowPoεf&wndBottom, rect .left. rect top, ect . right. rect bottom, SWP_NOZORDER | SWP_NOMOVE ),
// Add status bar
RECT sizerect sizerect.top - PS_HEIGHT; sizerect. bottom = eizerect.top + 20, βizerect. le t = 0,
Bizerect. ight = PS_WIDTH;
//m_StatuβBar Create (WS_CHILD | WS_VISIBLE | CCS_BOTTOM, sizerect , this, AFX_IDW_STATUS_BA ),
//m_StatusBar ShowWindow(SW_SHOWNA) ,
//m_StatusBar Setsimple () .-
//m_StatusBar SetText ( "Hello world! ".255, 0) , m_StatusBar Create (this) ;
//m_Statu8Bar SetIndicators (auIDStatusBar, sizeof (auIDStatusBar) /sizeof (UINT) ) ,-
//m_StatuβBar . Set Panelnfo(0, m_StatusBar GetltemID (0) . SBPS_STRETCH. NULL ) ,-
//m_StatusBar GetStatusBarCtrl ( ) SetText ( "Hello world' ".0, 0) ,-
CRect rcClientStart , CRect rcClientNow, GetClientRect (rcClientStart ) , RepoΞltlonBarε (AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_ AST, 0, reposQuery, rcClientNow) ,
// Now move all the controls so they are in the same relative // position within the remaining client area as they would be // with no control bars /* CPoint ptOffse (rcClientNow left - rcClientStart left, rcClientNow top - rcClientStart top) ,
CRect rcChild,
CWnd* pwndChild = GetWιndow(GW_CHILD) , while (pwndChild)
{ pwndChild- >GetWmdowRect (rcChild) ,
ScreenToClient (rcChild) , rcChild OffsetRect (ptOffset) , pwndChild- >MoveWindow(rcChιld, FALSE) , pwndChild = pwndChild- >GetNextWindow () , } */
// Adjust the dialog window dimensions
CRect rcWindow;
GetWindowRect (rcWindow) ; rcWindow. right += rcClientStart. idth( ) - rcClientNow.Width () ; rcWindow.bottom += rcClientStar .Heigh O - rcClientNow. Height O ; rcWindow.bot om += 5;
MoveWindow (rcWindow, FALSE) ;
// And position the control bars RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0) ; m_timerID = 0; m_timerID = SetTimer (TIMERID, SO, NULL) ; m_ErrorCounter = 0; m_HDCDDiεplay = falεe;
DiεplayMode (1) ;
SetWindowText("Untitled") ; partsList [0] = rcClientNow. idth () /4; partsList[l) = partsLis [0] + (rcClientNow. Width () /A ) ; partεLiεt[2] = partsList [1] + (rcClientNow. Width!) /4) ; partsLis [3] = -1; m_StatusBar.GetStatusBarCtrl() .SetParts (sizeof (partsList) /sizeo (int) .partsList) ;
return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE ) void CTabDialog: :OnClose() {
// if ( m_Pagel )
// delete m_Pagel;
// ιf( m_Page2 )
// delete m_Page2;
// if( m_Page3 )
// delete m_Page3; if( m_timerID )
KillTimerf m_timerID ) ; delete g_DSPManager,
CDialog OnCloseO; } void CTabDialog OnSysCommandtUINT nlD, LPARAM lParam) f if ( (nlD & OxFFFO) == IDM_ABOUTBOX) t
CTabAboutDlg dlgAbout, dlgAbout DoModa K )
} e lεe
{
CDia log OnSyεCommand (nlD lParam)
void CTabDialog OnPa t O
{
// CPaintDC dc(thιs) // device context for painting
// TODO Add your message handler coαe here
// Do not call CDialog OnPamtO for painting messages if ( Islcomc ( ) )
{
CPaintDC dc(thιs), // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc GetSafeHdcO, 0)
// Center icon in client rectangle int cxlcon = GetSystemMetπcs (SM_CXICON) , int cylcon = GetSystemMetrics (SM_CYICON) ,
CRect rect,
GetClientRec (irect) , mt x = (rect WidthO - cxlcon + 1) / 2, int y = (rect Height () - cylcon + 1) / 2,
// Draw the icon dc Drawlconfx, y, m_hIcon) ,
} else
{
//m_StatusBar RedrawWindo f ) ,
CDialog OnPamt O , }
} void CTabDialog OnMove Ont x, int y)
{
CDialog OnMove (x, y) ,
// TODO Add your message handler code here
}
// The syεtem calls this to obtain the cursor to display while the user drags
// the minimized window
HCURSOR CTabDialog OnQueryDraglcon 0
( return (HCURSOR) m_hIcon,
}
HBRUSH CTabDialog OnCt lColor (CDC* pDC, CWnd* pWnd UINT nCtlColor) {
HBRUSH hbr = CDialog OnCtlColor (pDC, pWnd, nCt lColor ) , // TODO Change any attributes of the DC here
// TODO Return a di f ferent brush i f the defaul t i s not desired return hbr (( i f 0 return m_brush ffendi f
void CTabDialog OnOpenMenu 0 { // TODO Add your command handler code here / char BASED_CODE ≤zFilterl) = 'Text Flit's (• txt)|* txt||" / CFileDialog fileDlg (TRUE, NULL, NULL, OL, szFilter, NULL) .
// CFileDialog fileDlg (TRUE) ,
CFileDialog fileDlg (TRUE, "tx ", NULL, OFN_HIDEREADONLY, "Text Files (* txt)|* txt|All
Files (• «)|* *| |", this) f( fileDlg DoModalO == IDOK. )
( int array__size = 0 ,
CString string,
CStringArray array;
CStdioFile fιle(fileDlg GetPathName (), CFile . modeRead j CFile typeText).- while! file ReadStriπg (string) )
( array SetAtGro (array_sιze , string ) , array sιze++;
) g_DSPManager->SetDSPSettings (array) ;
SetWmdowText (fileDlg GetFileName ( ) ) ;
// KM S/13/99 Invalidate the window so that window is redrawn
Invalidate (false) ,
void CTabDialog: :OnSaveMenu() {
// TODO. Add your command handler code here
CFileDialog fileDlg [FALSE, "txt", NULL, OFN_OVERWRITEPROMPT|OFN_HIDEREADONLY, "Text Files (*.txt)|« txt I I ", this); if( fileDlg DoModalO == IDOK )
{ int array_mdex = 0;
CStrmg string,
CStringArray array; g_DSPManager->GetDSPSettings (array) ;
CStdioFile ile (fileDlg. GetPathName 0 , CFile: :modeCreate | CFile -modeWrite | CFile: : ypeText) ; whilef array index < array. GetSizeO )
{ string = array .GetAt (array_index) , lie. riteStrin (string) ; file WriteString ( "\n") , array_index++;
}
)
void CTabDialog: :OnFileExportparam lie 0 {
CFileDialoq fileDlq( FALSE, "prm", NULL,OFN_OVERWRITEPROMPT|OFN_HIDEREADONLY, "Parameter Files (* prm) | * prm| | " , this) , if ( fileDlg DoModalO =- IDOK ) { int array_mdex = 0,
CString string,
CStringArray array, g_DSPManager->GetFιlterBlob(array) ,-
CStdioFile file [fileDlg GetPathNameO , CFile modeCreate | CFile modeWrite | CFile typeSmary) while! array_mdex < array GetSizeO )
{ string - arra .GetAt (array_ιndex> ; file WriteString (string) ; file WrιteString< "\n") , array_ιπdex++ ; } } ) void CTabDialog OnTιmer(UINT nIDEvent)
{
// TODO Add your message handler code here and/or call default ιf( nIDEvent == TIMERID )
{
DisplayMode (g_DSPManager- >GetHDCDMode O ) , DιsplayI2CState (OL) ,
} elεe
{
CDialog OnTimer (nIDEvent ) ,
}
void CTabDialog. -DisplayMode (int value) { if( value < 0 )
{
DisplayI2CState (-value) ,
/* char s [100] , sprintf (s, "0x%x", -value) ; m_ΞtatuεBar.GetStatuεBarCtrl() .SetTex (s, 3,0) ; */
/* if( m_timerID )
Killτimer( m_tιmerID ), CI2CCommErrorDialog dig, char s [100] ; εprintf (s, "0x%x" , -value) ,- dlg.m_ErrorCode = ε, ιf( dig. DoModalO == IDCANCEL )
EndDialo (IDCANCEL) ; elεe m_timerID = SetTimer (TIMERID, 50, NULL) ; */
} elεe if ( value )
{ if! !m_HDCDDiεplay )
{ m_ICnt = 0; m_AIdx = 0; m_StatuεBar GetStatusBarCtrl () .SetTex (Detect_Array [m_AIdx++] ,1,0) ;
//SetWindowText (Detect_Array [m_AIdx++] ) ;
) elεe
{ m_ICnt++; ιf( m_ICnt > S )
{ m_ICnt = 0; m_StatusBar. GetStatusBarCtrl () .SetText (Detect_Array[m_AIdx++) ,1,0) //SetWindowText (Detect_Array [m_AIdx++] ) ; ιf( m_AIdx >= AARRAYSIZE ) m_AIdx = 0, } } m_HDCDDisplay = true. elεe { ιf( m_HDCDDιεplay ) m_StatusBar GetStatusBarCtrl ( ) SetTextO'BAD CD NO DONUT",1,0)
//SetWindowText ("BAD CD NO DONUT"), m_HDCDDιsplay = falεe. void CTabDialog SetStatuεString (int which, CString & s) { m StatusBar GetStatusBarCtrl () SetTex (ε, 0, 0) ,
void CTabDialog Dιεplayl2CState (long error)
if ( error )
{ char s [100] , sprin (s, " 0x%x" , error) , m_ΞtatusBar GetStatusBarCtrl 0 SetText (ε, 3 , 0) , m_ErrorCounter = 100, // 5 seconds
} else
{ ιf( m_ErrorCounter )
{ m_ErrorCounter-- ; ιf( m_ErrorCounter > 0 ) re urn; } if! g_DSPManager->IsBusy () )
{ m_StatusBar GetStatusBarCtrl!) SetText ( "Transmitting..", 3, 0) ,
} else
{ m_StatusBar GetStatusBarCtrl!) SetTex ("", 3 , 0) ;
} }
ffi ! defined (AFX_STWAVEREJPAGE_H 0CF7E209_D790_11D2_9GEE_006097CDB9E2 INCLUDED_)
((define AFX_STWAVEREJPAGE_H OCF7E209_D790_11D2_96EE_OOS097CDB9E2 INCLUDED_
Si _MSC_VER >= 1000
((pragma once ffendif // _MΞC_VER >= 1000
// StWaveRej Page . h : header f i le
//
I! CStWaveRe Page dialog class CTabDialog; claεs CStWaveRe Page : public CPropertyPage
{
DECLARΞ__DYNCREATE (CStWaveRej Page )
// Construction public:
CStWaveRej Page ( ) ;
-CStWaveRej Page ( ) ;
// Dialog Data
//{ {AFX_DATA(CStWaveRejPage) enum { IDD = IDD_PP5 } ; CButton m_BypasεButton; CSliderCtrl π_Notch3BoostSlider ,- CSliderCtrl m_Notch3QSlider ; CSliderCtrl m_Notch2CutSlider; CSliderCtrl m_Notch2QSlider; CSliderCtrl m_Notch2FreqSlider,- CSliderCtrl m_NotchlCutSlider; CSliderCtrl m_NotchlQSlider; CSliderCtrl m_NotchlFreqSlider,- //) )AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
// { {AFX VIRTUAL [CStWaveRej Page) protected: virtual void DoDataExchange (CDataExchange* pDX) ; // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation protected :
// Generated message map functions
//{ {AFX MSG (CStWaveRej Page) virtual BOOL OnlnitDialo () ; afx_msg void OnVScroll (UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) ; afx_msg void OnShowWindow (BOOL bShow, UINT nStatus) ; afx_msg void OnPaint ; afx_msg void OnBypass () ,-
//}}AFX_MSG
DECLARE_MESSAGE_MAP ( )
CTabDialog *m_ParentWindow; void SendStringToUI (int which);
};
//( {AFX_INSERT_LOCATION} }
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STWAVEREJPAGE H 0CF7E209_D790_llD2_96EE_O06097CDB9E2 INCLUDED_) // StWaveRejPage cpp implementat ion f i le //
(( include " εtdaf x h " ff include " sa h"
(( include "StWaveRe3 page h"
((include "TabDialog h" ff include "DSP56kManager h " ff l fdef _DEBUG
((def ine new DEBUG_NEW ff undef THIS_FILE static char THIS_FILE [ ) = FILE ff endi f mi mil iiimiii i 11 i/i ii
II CStWaveRejPage property page IMPLEMENT_DYNCREATE(CStWaveRe3Page, CPropertyPage)
CStWaveRe3Page- CStWaveRe Page!) - CPropertyPage (CStWaveRejPage -- IDD)
(
//{{AFX_DATA_INIT (CStWaveRej Page)
//} }AFX_DATA_INIT }
CStWaveRej Page : : -CStWaveRej Page ( )
{
} void CStWaveRe3 Page: -DoDataExchange (CDataExchange* pDX)
{
CPropertyPage.- : DoDataExchange (pDX) ,
// { {AFX_DATA_MAP (CStWaveRe3 Page)
DDX_Control (pDX, IDC_CHECK5, m_BypaεsButton) ;
DDX_Control (pDX, IDC_SLIDER9, m_Notch3BoostSlider) , DDX_Control (pDX, IDC_SLIDER8, m_Notch3QSlider) ; DDX_Control (pDX, IDC_SLIDER6, m_Notch2CutSlider) ; DDX_Control (pDX, IDC_SLIDER5, m_Notch2QSlider) ; DDX_Control (pDX, IDC_SLIDER4, m_Notch2FreqSlider) ; DDX_Control (pDX, IDC_SLIDER3, m_NotchlCutSlider) ; DDX_Control (pDX, IDC_SLIDER2, m_NotchlQSlιder) ; DDX_Control (pDX, IDC SLIDER1, m_NotchlFreqSlider) ,- // } }AFX_DATA_MAP
BEGIN_MESSAGE_MAP (CStWaveRej Page, CPropertyPage)
// { {AFX_MSG_MAP (CStWaveRej Page)
ON_WM_VSCROL ( )
ON_WM_SHOWWINDOW ()
ON_WM_PAINT()
ON_BN_CLICKED(IDC_CHECKS, OnBypass)
//)}AFX_MSG_MAP END_MESSAGE_MAP ( ) i tiiuiiiimimiiu ii ii urn imimiui ui i u mm
II CStWaveRejPage message handlers
BOOL CStWaveRejPage OnlnitDialog 0
{
CPropertyPage .OnlnitDialog () ;
// TODO Add extra initialization here m_NotchlFreqSlιder SetRange (0, CONTROL_RANGE) ; m_NotchlFreqSlιder SetPos (cONTROL_RANGE-g_DSPManager->GetParamValue (kNotch3Freq) m_NotchlFreqSlιder SetTicFreqf (CONTROL_RANGE+l) /16) , m_NotchlFreqSlιder SetPageSize (PG_CONTROL_AMT) , m_NotchlQSlιder SetRange (0, CONTROL_RANGE) , m_NotchlQSlιder SetPoε (CONTROL_RANGE-g_DSPManager- >GetParamValue (kNotch3Q) ) , m_NotchlQSlιder SetTicFreq ( (CONTROL_RANGE+l) /16) , m_NotchlQSlιder SetPageSize (PG_CONTROL_AMT) m_NotchlCutSlιder SetRangelO CONTROL_RANGE) , m_NotchlCutSlιder SetPos (CONTROL_RANGE-g_DSPManager >Get ParamValue (kNotch3Cut) ) m_NotchlCutSlιder SetTιcFreq( (CONTROL_RANGE+l) /16) m_NotchlCutSlιder SetPageSize ( PG_CONTROL_AMT) , m_Notch2FreqSlιder SetRange (0, CONTROL_RANGE) , m_Notch2FreqSlιder SetPos (CONTROL_RANGE-g_DSPManager >GetParamValue (kNotch4Freq) ) m_Notch2FreqSlιder SetTicFreq! (CONTROL_RANGE+l) /16) m_Notch2FreqSlιder SetPageSize (PG_CONTROL_AMT) m_Notch2QSlιder SetRange (0 CONTROL_RANGE) , m_Notch2QSlιder SetPos (CONTROL_RANGE-g_DSPManager--.GetParamValue (kNotch4Q) ) m_Notch2QSlιder SetTicFreq ( (CONTROL_RANGE+l) /16) m_Notch2QSlιder SetPageSize ( PG_CONTROL_AMT) , m_Notch2CutSlιder SetRange (0, CONTROL_RANGE) , m_Notch2CutSlιder SetPos (CONTROL_RANGE-g_DSPManager >GetParamValue (kNotch4Cut) ) , m_Notch2CutSlιder SetTicFreq! (CONTROL_RANGE+l) /16) , m_Notch2CutSlιder SetPageSize ( PG_CONTROL_AMT) , m_Notch3QSlιder SetRange (0,CONTROL_RANGE) , m_Notch3QSlιder SetPos(CONTROL_RANGE-g_DSPManager->GetParamValue (kNotch5Q) ) . m_Notch3QSlιder SetTicFreq! (CONTROL_RANGE+l) /16) , m_Notch3QSlιder SetPageSize (PG_CONTROL_AMT) , m_Notch3BoostSlιder.SetRange(0,CONTROL_RANGE) , m_Notch3BoostSlιder. SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kNotchSCut) ) , m_Notch3BoostSlιder SetTicFreq! (CONTROL_RANGE+l) /16) , m_Notch3BoostSlιder SetPageSize (PG_CONTROL_AMT) ,
m_ParentWmdow = (CTabDialog *) GetParent () ->GetParent O return TRUE, // return TRUE unless you set the focus to a control // EXCEPTION OCX Property Pages should return FALSE } void CStWaveRejPage SendStringToUI (mt which) {
CString str, g_DSPManager->GetStrιngValue (which, str) , m_ParentWιndow- >SetStatusString ( 0 , εtr) ,
} void CStWaveRe3Page OnVScroll (UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO Add your message handler code here and/or call default CSliderCtrl *slιder = (CSliderCtrl *)pScrollBar, int which,
CPropertyPage OnVScroll (nSBCode, nPos, pScrollBar),
Sleep(SO) , ιf( slider == &m_NotchlFreqSlιder ) which = kNotch3Freq, else if ( slider == &m_NotchlQSlιder ) which = kNotch3Q, else ιf( slider == &m_NotchlCutSlιder ) which = kNotch3Cut, elεe ιf( slider == fcm_Notch2FreqSlιder ) which = kNotch4Freq, elεe ιf( εlider == &m_Notch2QSlιder ) which - kNotch4Q, elεe iff slider == &m_Notch2CutSlιder ) which = kNotch4Cut, elεe ιf( slider == S,m_Notch3QSlιder ) which = kNotch5Q, else if( slider == &m_Notch3BoostSlιαer ) which = kNotchSCut, elεe return, g_DSPManager- >SetParamValue (CONTROL_RΛNGE-slιder->GetPos ( ) , which) , SendStringToUI (which) ,
void CΞtWaveRe Paαe OnShowWindow (BOOL bShow, UINT nStatus)
{
CPropertyPage OnShowWindo (bShow, nStatus),
// TODO Add your message handler code here
) void CStWaveRe3Page. OnPamtO
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here m_NotchlFreqSlider .SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (k otchJFreq) ) , m_NotchlQSlider SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kNotch3Q) ) ; m_NotchlCutSlider. SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue ONotch3Cut) ) ; m_Notch2FreqSlider .SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kNotch4Freq) ) , m_Notch2QSlider. SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue(kNotch4Q) ) ; m_Notch2CutSlιder. SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kNotch4Cut) ) ; m_Notch3QSlιder .SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kNotch5Q) ) m_Notch3BoostSlider SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kNotch5Cut) ) , m_BypassButton SetCheck (g_DSPManager->GetBypaεsSec ion (kBypassConecry) ) ; // Do not call CPropertyPage : :OnPaint ( ) for painting messages } void CStWaveRe Page -OnBypass ()
{
// TODO: Add your control notification handler code here int state = m_BypassBu ton GetStateO & 0x3; g_DSPManager->SetBypassSection (state, kBypassConecry) ,- }
There a number of blocks (processing units) The signal flow is linear currently Each item is an aεcii line of text The file format is as follows version number block type number of params for block block param f(l block param j(2 block param S3 block param ffn block type number of params for block block param #1 block param ff2 block param #3 block param ffn
// file version number ffdefine BLOB_FILE_VERSION 1
// block type descriptor typedef enum {
BLOCK_DELAY,
BLOCK_GAIN,
BLOCK PEQ,
BLOCK_AP,
BLOCK_LS,
BLOCK_HS,
BLOCK_HP,
BLOCK_LP,
BLOCK_LP2 } ProcessType;
// SPIPEMicroComm h. interface for the SPIPEMicroComm class
//
////////////////////////////////////////////////////////////////////// ffif .'defined (AFX_SPIPEMICROCOMM_H 33F9EF06_F6EF_11D2_96EE_006097CDB9E2 INCLUDED_) ffdefine AFX_SPIPEMICROCOMM_H 33F9EF06_F6EF_11D2_9GEE_OOG097CDB9E2 INCLUDED_
((if _MSC_VER >= 1000
((pragma once
((endif // _MSC_VER >= 1000
((include "DSPComm.h" clasε SPIPEMicroComm : public DSPComm { int cmd_delay, int io_delay,- public:
SPIPEMicroComm () ; virtual -SPIPEMicroComm () ; virtual long SendDSPWor (long) ; virtual long SendDSPMemory (char *,long);
} ffendif // ! def ined (AFX_SPIPEMICROCOMM_H 33F9EF06_F6EF_11D2_96EE_006097CDB9E2 INCLUDED_)
// SPIPEMicroComm cpp implementation of the SPIPEMicroComm class // luiium/i i imniinmi/iiim/uri/ni/iimiiiimtminmim
H mclude " s tda fx h "
Sinclude " sa h"
((include "SPI PEMicroComm h"
S include "ujιι t_ppι h" (( include functs h ' ff l fdef _DEBUG ffundef THIS_FILE static char THIS_FILE[)- FILE
((def ine new DEBUG_NEW ff endi f ιuιιιιιιιιuumιιιuιιιιιιιιιιιu!uιιi!iιιιιιιι/ιιιιιuι//ιι/ιιιιι
II Construction/Destruction
!utιιιιιιιιnιιmιιuι/ιιιιιιιιιιιιιιιi!iιιιιιιιιιιuιιnιιιιιιιιιιι
SPIPEMicroComm SPIPEMicroComm! )
{ cmd_delay = 1000, ιo_delay - SO, ιf( load_dll()==fal5e )
(
MessageBox(NULL, "UNIT_PPI not found m the system directory Fix this and restart application Will Robinson", MB_0K | MB_ICONSTOP ) ,
} elεe f mitjort spι(l) , set_cmd_delay_cnt_value (cmd_delay) . set_ιo_delay_cπt_value (io_delay) . }
SPIPEMicroComm -SPIPEMicroCommO {
long SPIPEMicroCoiraπ SendDSPWorddong value) { return! spι_xchng2 (value) ), ) long SPIPEMicroComm SendDSPMemory (char *data, long len) [ return! OL ) «lf ' defined (AFX_SHELVPAGE_H GF151624_D84D_11D2_9SEE_00G097CD89E2 INCLUDED_)
((define AFX_SHELVPAGE_H 6F151624_D8 D_11D2_9SEE_006097CDB9E2 INCLUDED_ fllf _MSC_VER >= 1000 ffpragma once
(fendi f // _MSC_VER >= 1000
// ShelvPage h header file
// Ulll III
II CShelvPage dialog class CTabDialog class CShelvPage public CPropertyPage
{
DECLARE_DYNCREATE (CShelvPage)
// Construction public
CShelvPage () ,
-CShelvPage!) ,
// Dialog Data
// { {AFX_DATA (CShe1vPage ) enum ( IDD = IDD_PP6 }, CButton πi BypassSecondButton, CButton τn_BypassFιrstButton, CSliderCtrl m_HιBoostSlιder, CSliderCtrl m_HiFreqSlιder, CSliderCtrl m_L0BoostSlider, CSliderCtrl m_LoFreqSlιder //}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_viRTUAL (CShelvPage) protected virtual void DoDataExchange (CDataExchange* pDX) ; // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation protected
// Generated message map functions
// { {AFX_MSG (CShelvPage) virtual BOOL OnlnitDialog 0 , afx_msg void OnVScroll (UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) afx_msg void OnShowWindo (BOOL bShow, UINT nStatus); afx_msg void OnPamtO, afx_msg void OnBypassFirs () , afx_msg void OnBypassΞecondO
//}}AFX_MSG
DECLARE_MESSAGE_MAP ( )
CTabDialog *ra_ParentW dow, void SendStringToUI ( t which) ,
// ( {AFX_INSERT_LOCATION} }
// Microsof t Developer Studio will insert additional declarat ions immediately before the previous line ff endif // ' def ined (AFX_SHELVPAGE_H 6F151624_D84D_11D2_96EE_OOS097CDB9E2 INCLUDED_) // ShelvPage cpp implementation file //
((include "stdafx h" ffinclude "sa h"
((include "ShelvPage h"
((include "TabDialog h"
((include "DSP56kManager h" fflfdef _DEBUG ((define new DEBUG_NEW ttundef THIS_FILE static char THIS_FILE[] = FILE , ffendif uu ii /mm urn ii /uu imiiii i ui IIIII ii i ii ii 11 ii ii in 11 ii i
II CShelvPage property page IMPLEMENT_DYNCREATE (CShelvPage, CPropertyPage)
CShelvPage CShelvPage 0 • CPropertyPage (CShelvPage IDD)
(
// { (AFX_DATA_INIT (CShelvPage)
//} }AFX_DATA_INIT )
CShelvPage -CShelvPage ( )
{
} void CShelvPage- -DoDataExchange (CDataExchange* pDX)
{
CPropertyPage -DoDataExchange (pDX) , // { {AFX_DATA_MAP (CShelvPage)
DDX_Control(pDX, IDC_CHECK3, m_BypassSecondButton) , DDX_Control[pDX, IDC_CHEC 1, m_BypassFirstButton) ; DDX_Control(pDX, IDC_SLIDER6, m_HιBoostSlider) ; DDX_Control(pDX, IDC_SLIDER4, m_HιFreqSlιder) ; DDX_Control (pDX, IDC_SLIDER3, m_LoBoostSlider) ; DDX_Control(pDX, IDC_SLIDER1, m_LoFreqSlider) ; // } }AFX_DATA_MAP
BEGIN_MESSAGE_MAP (CShelvPage, CPropertyPage)
//{{AFX_MSG_MAP (CShelvPage)
ON_WM_VSCROLL()
ON_WM_SHOWWIND0W()
ON_WM_PAINT ( )
ON_BN_CLICKED(IDC_CHECKl, OnBypassFirst)
ON_BN_CLICKED (IDC_CHECK3 , OnBypassSecond)
//}}AFX_MSG_MAP END_MESSAGE_MAP ( ) /iiiiiiiiiiimiiiiiiii mm imiiiiiiiii/i milt Hum
1/ CShelvPage message handlers
BOOL CShelvPage OnlnitDialo () {
CPropertyPage OnlnitDialog () ,
// TODO Add extra initialization here m_LoFreqSlιder SetRange (0, CONTROL_RANGE) , m_LoFreqSlιder SetPos (CONTROL_RANGE-g_DSPManager->Get ParamValue (kLoShelfFreq) ) m_LoFreqSlιder SetTicFreqf (C0NTROL_RANGE+l) /16) , m_LoFreqSlιder SetPageSize (PG_CONTROL_AMT) , m_LoBoostSlιder SetRange (0, CONTROL_RANGE) , m_LoBoostSlιder SetPoε (CONTROL_RANGE-g_DSPManager->GetParamValue (kLoShelfGain) ) m_LoBooεtSlιder SetTicFreqf (CONTROL_RANGE+l) /16) , m_LoBoostSlιder SetPageSize (PG_CONTROL_AMT) , m_HιFreqSlιder SetRange (0, CONTROL_RANGE) , m_HιFreqSlιder SetPos (CONTROL_RANGE-g_DSPManager- >Get ParamValue (kHiShelfFreq) ) , m_HιFreqSlιder SetTicFreqf (CONTROL_RANGE+l) /16) , m_HιFreqSlιder SetPageSize (PG_CONTROL_AMT) , m_HιBoostSlιder SetRange ( 0, CONTROL_RANGE) , m_HιBoostSlider SetPos (CONTROL_RANGE-g_DSPManager- >Get ParamValue (kHiShelfGain) ) m_HιBoostSlιder SetTicFreq! (CONTROL_RANGE+l ) /16) , m_HιBoo tSlιder SetPageSize (PG_CONTROL_AMT) ,
m_ParentWmdow = (CTabDialog *) GetParen () ->Get Paren ( ) return TRUE, // return TRUE unless you set the focus to a control // EXCEPTION OCX Property Pages should return FALSE ) void CShelvPage OnVScroll (UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO- Add your eεεage handler code here and/or call default CSliderCtrl 'slider = (CSliderCtrl *) pScrollBar , int which,
CPropertyPage: OnVScroll (nSBCode, nPos, pScrollBar);
Sleep (50) ,- if ( slider == £m_LoFreqSlιder ) which = kLoShelfFreq, elεe ιf( slider == &m_LoBoostSlιder ) which = kLoShelfGain; elεe if! slider == S.m_HιFreqSlιder ) which = kHiShelfFreq, else if! slider == &m_HιBoostSlιder ) which = kHiShelfGain, else return; g_DSPManager- >Set ParamValue (CONTROL_RANGE- slιder- >GetPos ( ) , which) , SendStringToUI (which) ;
} void CShelvPage: : SendStringToUI (int which) {
CString str; g_DSPManager->GetStringValue (which, str) ; m_ParentWindow->SetStatusStπng(0, str) ,
void CShelvPage OnShowWindow (BOOL bShow, UINT nStatus)
{
CPropertyPage- OnShowWindow (bShow, nStatus),
// TODO Add your message handler code here
void CShelvPage OnPam O {
CPaintDC dc(thιε), // device context for painting
// TODO Add your mesεage handler code here m_LoFreqSlιder SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kLoShelfFreq) ) , m_LoBoostSlιder SetPos (CONTROL_RANGE-g_DSPManager- >GetParamValue (kLoShelfGain) ) m_HιFreqSlιder SetPos (CONTROL_RANGE-g_DSPManager->GetParamValue (kHiShelfFreq) ) , m_HιBoostSlider SetPos (CONTROL_RANGE-g_DSPManager- >GetParamValue (kHiShelfGain) ) m_BypassFιrβtButton SetCheck (g_DSPManager->GetBypaεεSectιon (kBypasεLoεhelf) ) , m_BypassSecondButton SetCheck (g_DSPManager- >GetBypassSect ion (kBypassHiShelf ) ) , // Do not call CPropei tyPage OnPamtO for painting messages ) void CShelvPage OnBypassFirεt ( )
{
// TODO Add your control notification handler code here t state = m_BypasεFιrstButton GetStateO & 0x3, g_DSPManager->Se BypassSect ion (stat , BypassLoshelf ) ,
} void CShelvPage OnBypassSecond ( )
(
// TODO Add your control notification handler code here mt state = m_BypassΞecondButton GetStateO & 0x3, g_DSPManager->SetBypassSection (state, BypassHiShelf) ;
//Microsof t Developer Studio generated resource script -
//
(( include "resource , h"
((de f ine APSTUDIO_READONLY_SYMBOLS
II
1/ Generated from the TEXTINCLUDE 2 resource.
//
((include "afxres.h"
I III Ulll I lll/IUU f unde f APSTUDIO_READONLY_SYMBOLS iim miiimmmiiiiiimum ui mil i ui mill
II English (U.S.) resources ffif !defined(AFX_RESOURCE_DLL) || defined (AFX_TARG_ENU) ffifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
((pragma code_page (1252) ffendif //_WIN32 ffifdef APSTUDIO_INVOKED II
II TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE BEGIN
"resource. h\0" END
2 TEXTINCLUDE DISCARDABLE BEGIN
" ff include " "afxres . h" "\r\n" " \0 " END
3 TEXTINCLUDE DISCARDABLE BEGIN
" #de ine _AFX_NO_SPLITTER_RESOURCES\r\n" " ffdefine _AFX_NO_OLE_RESOURCES\r\n" " ffdefine _AFX_NO_TRACKER_RESOURCES\r\n" "fdefine _AFX_NO_PROPERTY_RESOURCES\r\n" "\r\n"
"ffif !define (AFX_RESOURCE_DLL) || defined (AFX_TARG_ENU) \r\n" "#ifdef _WIN32\r\n" "LANGUAGE 9, l\r\n" "ffpragma code page (1252) \r\n" "#endif\r\n"
"ffinclude " "res\\εa.rc2"" // non-Microsoft Visual C++ edited resources\r\n" "ffinclude " "afxres. re" " // Standard componentε\r\n" "#endif\0" END ffendif // APSTUDIO_INVOKED
umimiui ii ui uuimiiiiiim ui imiiiiiiiui mum ti mini i
II
II Icon //
// Icon with lowest ID value placed first to ensure application icon
// remains consiεtent on all systems.
IDR_MAINFRAME ICON DISCARDABLE "res\ \sa . ico "
UI III III I Ulllll! 'Ill III 'III '11111111
II
II Dialog //
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 259, 55
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About KOJ'ε Amazing Town Crier"
FONT 8, "MS Sans Serif"
BEGIN
ICON IDR_MAINFRAME, IDC_STATIC, 11, 17, 21,20 LTEXT "KOJ's Amazing Town Crier Version 1.0" , IDC_STATIC, 40, 10 ,
119, 8,SS_NOPREFIX
LTEXT "Copyright (C) PMI 1999 " , IDC_STATIC, 40, 25, 119, 8 DEFPUSHBUTTON "OK", IDOK, 220, 7,32, 1 ,WS_GROUP END
IDD_SA_DIALOG DIALOGEX 0, 0, 229, 175
STYLE DS_MODALFRAME | WS_P0PUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "SuperAudio"
FONT 8. "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK". IDOK, 172,7,50, 14 PUSHBUTTON "Cancel", IDCANCEL.172, 23, 50, 14 PUSHBUTTON "Poke Sequence ff1" , IDC_BUTTONl , 35, 83, 109, 25 PUSHBU TON "Poke Sequence #2 " , IDC_BUTTON2, 3 , 123 , 115, 28
END
IDD_DIALOGl DIALOG DISCARDABLE 0, 0, 236, 229
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "KOJ's Amazing Town Crier"
MENU IDR_MENTJ1
FONT 8, "MS Sanε Serif"
BEGIN
END
IDD_PP1 DIALOG DISCARDABLE 0, 0, 195, 127
STYLE WS_CHILD | WS DISABLED | WS_CAPTION
CAPTION "Teεt"
FONT 8, "MS Sans Serif"
BEGIN
PUSHBUTTON "Send SPI Sequence ffl", IDC_BUTTONl, 57, 36, 86, 22 PUSHBUTTON "Send SPI Sequence «2", IDC_BUTTON2, 55, 81 , 93 , 31
END
IDD_PP2 DIALOG DISCARDABLE 0, 0, 288, 146
STYLE WS_CHILD | WS_DISABLED | WS CAPTION
CAPTION "Main"
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "Sliderl",IDC_SLIDERl, "msctlε_trackbar32 " , TBS_AUTOTICKS |
TBS_VERT I WS_TABSTOP, 58,25,22, 86
LTEXT "Pre",IDC_STATIC,28,117,12, 8 CONTROL "Bypass Processing" , IDC_CHECK1, "Button", BS_AUTOCHECKBOX |
WS TABSTOP, 173, 57, 76, 10
CONTROL "Sliderl", IDC_SLIDER3, "msctls_trackbar32 " , TBS_AUTOTICKS |
TBS_VERT I WS_TABSTOP, 27,25,22,86
LTEXT "Post",IDC_STATIC,57,117,15,8
GROUPBOX "Volume", IDC_STATIC, 19, 15, 135, 118
CONTROL "Bypaεε HDCD", IDC_CHECK2, "Button" , BS_AUTOCHECKBOX |
WS_TABSTOP, 173 , 74 , 76, 10
CONTROL "Bypaεs HDCD Gain Scale" , IDC_CHECK3 , "Button" ,
BS_AUTC HECKBOX | WS_TABSTOP,173,91,98,10
PUSHBUTTON "Reset All", IDC_BUTTONl, 173, 31, 50, 14 CONTROL "Analog Input" , IDC_CHECK4 , "Button" , BS_AUTOCHECKBOX |
WS_TABSTOP, 173, 108,56, 10
CONTROL "Sliderl", IDC SLIDER7, "msctls_trackbar32 " , TBS_AUTOTICKS |
TBS_VERT I WS_TABSTOP, 89, 25,22, 86
LTEXT "Analog", IDC_STATIC, 85, 117, 23, 8 CONTROL "Sliderl" , IDC_SLIDER8, "msctlε_trackbar32" , TBS_AUTOTICKS |
TBS_VERT I WS_TABSTOP, 119, 25,22, 86
LTEXT "Delay", IDC_STATIC, 117, 117, 19, 8
END IDD_PP3 DIALOG DISCARDABLE 0, 0, 195, 127 STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Compression" FONT 8, "MS Sans Serif" BEGIN
CONTROL "Bypass Compression" , IDC_CHECK1, "Button" , BS_AUTOCHECKBOX
WS__TABSTOP, 29, 24, 104, 10 END
IDD_PP4 DIALOG DISCARDABLE 0, 0, 244, 159 STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Resonance Compensation" FONT 8, "MS Sans Serif" BEGIN
CONTROL "Sliderl , IDC_SLIDER1, "rnsctls_trackbar32 " , TBS AUTOTICKS
TBS_VERT I WS_TABSTOP,20,24,20,85
CONTROL "Sliderl , IDC_SLIDER2, "msctls_trackbar32 " , TBS AUTOTICKS
TBS_VERT I WS_TABSTOP,48,24,21,85
CONTROL "Sliderl , IDC_SLIDER3, "msctls_trackjbar32 " , TBS AUTOTICKS
TBS VERT I WS_TABSTOP,76,24,20,85
LTEXT "Freq. ", IDC_STATIC, 17, 113, 20, 11
LTEXT "Q", IDC_STATIC,51, 113,8,11
LTEXT "Cut/Boost " , IDC_STATIC, 71,113,33,11
GROUPBOX "First Notch", IDC_STATIC, 11,15,98,111
CONTROL "Sliderl", IDC_SLIDER4, "rosctls_trackbar32" ,TBS AUTOTICKS TBS_VERT I WS_TABSTOP,137,24,24,85
CONTROL "Sliderl", IDC_SLIDER5, "msctlε_trackbar32" ,TBS_AUTOTICKS TBS_VERT I WS_TABSTOP,165,24,21,85
CONTROL "Sliderl", IDC_SLIDER6, "msctls_trackbar32 " ,TBS_AUTOTICKS TBS_VERT I WS_TABSTOP, 193,24,22,85
LTEXT "Freq. " , IDC_STATIC, 135, 113 , 20, 11
LTEXT "Q", IDC_STATIC,169,113,8, 11
LTEXT "Cut/Boost", IDC_STATIC, 189,113,32,11
GROUPBOX "Second Notch", IDC_STATIC, 129, 15, 98, 111
CONTROL "Bypass" , IDC_CHECK5, "Button" , BS_AUTOCHECKBOX | WS_TABSTOP,33, 136,39,10
CONTROL "Bypass " , IDC_CHECK6, "Button" , BS_AUTOCHECKBOX | WS TABSTOP, 153, 136, 39, 10
END
IDD_PP5 DIALOG DISCARDABLE 0, 0, 339, 162 STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Standing Wave Rejection" FONT 8, "MS Sans Serif" BEGIN
CONTROL "Sliderl", IDC_SLIDER1, nmsctls_trackJar32" TBS_AUTOTICKS
TBS_VERT I WS_TABSTOP,20,24,20,85 CONTROL "Sliderl", IDC_SLIDER2, "msctlε_trackbar32" TBS_AUTOTICKS
TBS_VERT I WS_TABSTOP/48,24,21,85 CONTROL "Sliderl", IDC_SLIDER3, "msctls_trackbar32\ TBS AUTOTICKS
TBS_VERT I WS_TABSTOP,76,24,20,85 LTEXT "Freq. ", IDC_STATIC, 17, 113, 20, 11
LTEXT "Q", IDC_STATIC, 51, 113,8,11
LTEXT "Cut/Boost", IDC_STATIC,70,113,35,11
GROUPBOX "First Notch" , IDC_STATIC, 11, 15, 98, 111 CONTROL "Sliderl", IDC_SLIDER4, "msctls_trackbar32" , TBS_AUTOTICKS
TBS_VERT I WS_TABSTOP,229,24,24,85 CONTROL "Sliderl", IDC_SLIDER5, "msctls_tracκbar32" , TBS_AUTOTICKS
TBS_VERT I WS_TABSTOP,257,24,21,85 CONTROL "Sliderl". IDC_SLIDERG, "msctls_trackbar32" , TBS AUTOTICKS
TBS_VERT j WS_TABSTOP,28S,24,22,85 LTEXT "Freq. ", IDC_STATIC, 227, 113 , 20, 11
LTEXT "Q", IDC_STATIC,261,113,8, 11
LTEXT "Cut/Boost", IDC_STATIC,280,113,34,11
GROUPBOX "Second Notch" , IDC_STATIC, 221, 15, 98, 111 CONTROL "Sliderl", IDC_SLIDER8, "msc ls_trackbar32 " , TBS_AUTOTICKS
TBS_VERT I WS_TABSTOP, 140,25,21, 85 CONTROL "Sliderl", IDC_SLIDER9, "msctls_trackbar32" , TBS AUTOTICKS
TBS_VERT I WS_TABSTOP, 168,25,22,85 LTEXT "Q", IDC_STATIC, 144,114,8,11
LTEXT "Cut/Booεt", IDC_STATIC, 163, 114 , 34, 11
GROUPBOX "Boost Compensation" , IDC_STATIC, 125, 15 , 77 , 111 CONTROL "Bypass", IDC_CHECK5, "Button" , BS_AUTOCHECKBOX WS TABSTOP, 146, 137, 1 , 10
END
IDD_PP6 DIALOG DISCARDABLE 0, 0, 187, 162 STYLE WS_CHILD I WS_DISABLED I WS CAPTION CAPTION "Smiley Face" FONT 8, "MS Sans Serif" BEGIN
CONTROL "Sliderl" , IDC_SLIDER1, "msc ls_trackbar32 " , TBS_AUTOTICKS |
TBS_VERT I WS_TABSTOP, 20, 24, 20, 85
CONTROL "Sliderl", IDC_SLIDER3, "msc ls_trackbar32 " , TBS_AUTOTICKS |
TBS_VERT I WS_TABSTOP,50,24, 20, 85
LTEXT "Freq. ", -1, 17, 113, 20, 11 LTEXT "Cut/Boost", -1,43.113, 34, 11 GROUPBOX "Lo-Shelf ", -1, 11, 15,70, 111 CONTROL "Sliderl", IDC_SLIDER4, "msct ls_trackbar32 " , TBS_AUTOTICKS |
TBS_VERT I WS_TABSTOP,108, 24,24, 85
CONTROL "Sliderl", IDC_SLIDER6, "msctls_trackbar32 " , BS_AUTOTICKS |
TBS_VERT I WS_TABSTOP, 139, 24,22,85
LTEXT "Freq. ",-1,106, 113, 20, 11 LTEXT "Cut/Boost", -1, 134, 113, 33, 11 GROUPBOX "Hi-Shelf ",-1,100, IS, 69, 111 CONTROL "Bypaεs",IDC_CHECKl, "Button", BS_AUTOCHECKBOX |
WS_TABSTOP,25,136,37,12
CONTROL "Bypass", IDC_CHECK3, "Button", BS_AUTOCHECKBOX |
WS TABSTOP, 115, 136, 37, 12
END
IDD_PP7 DIALOG DISCARDABLE 0, 0, 242, 162 STYLE WS_CHILD | WS_DISABLED | WS CAPTION CAPTION "Cutoff Responεe" FONT 8, "MS Sans Serif" BEGIN
CONTROL "Sliderl", IDC_SLIDER1, "msctls_trackbar32 " , TBS_AUTOTICKS |
TBS_VERT I WS_TABSTOP, 20, 24,20,85
CONTROL "Sliderl", IDC_SLIDER2, "msctls_trackbar32" , TBS_AUTOTICKS |
TBS_VERT I WSJTABSTOP, 48, 24 ,21, 85
CONTROL "Sliderl", IDC_SLIDER3, »msctlε_trackbar32" , TBS_AUTOTICKS |
TBS_VERT I WS_TABSTOP, 76,24,20,85
LTEXT "Freq. " , IDC_STATIC, 17, 113, 20, 11
LTEXT "Q",IDC_STATIC,51,113, 8,11
LTEXT "Cut/Boost " , IDC_STATIC, 71,113,33,11
GROUPBOX "Low Cutoff", IDC_STATIC, 11, 15, 98,111
CONTROL "Sliderl", IDC_SLIDER4, "msctls_trackbar32",TBS_AUTOTICKS |
TBS_VERT I WS_TABSTOP, 137,24,24, 85
CONTROL "Sliderl", IDC_SLIDER5, "msctls_trackbar32" , TBS_AUTOTICKS |
TBS_VERT I WS TABSTOP, 165,24,21,85
CONTROL "Sliderl", IDC_SLIDER6, "mεctlε_trackbar32 " , TBS_AUTOTICKS |
TBS_VERT I WS_TABSTOP, 193,24,22,85
LTEXT "Freq. " , IDC_STATIC, 135, 113, 20, 11
LTEXT "Q", IDC_STATIC, 169, 113, 8, 11
LTEXT "Cut/Boost", IDC_STATIC,189,113,32,11
GROUPBOX "High Cutoff ", IDC_STATIC, 129, 15, 98, 111
CONTROL "Bypaεs",IDC_CHECK5, "Button" , BS_AUTOCHECKBOX |
WS_TABSTOP,39,139,41,12
CONTROL "Bypass " , IDC_CHECK6 , "Button" , BS_AUTOCHECKBOX |
WS_TABSTOP, 154 , 139 , 1 , 12
END
IDD_PP8 DIALOG DISCARDABLE 0, 0, 285, 164 STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Cutoff Response" FONT 8, "MS Sans Serif" BEGIN
CONTROL "Sliderl" , IDC_SL1DER1, "mεctls_trackbar32 " , TBS_AUTOTICKS |
TBS_VERT I WSJTABSTOP, 20, 24, 20, 85
CONTROL "Sliderl" , IDC_SLIDER2, "mεctls_trackbar32 " , TBS_AUTOTICKS |
TBSJVERT I WS_TABSTOP, 8, 24, 21, 85
LTEXT "Freq.",- 1, 17,113,20,11
LTEXT "Q", -1.51,113,8, 11 GROUPBOX "Low Cutoff", -1, 11, 15, 71,111 CONTROL "Sliderl". IDC_SLIDER4. "msct ls_ rackbar32 " , TBS_AUTOTICKS
TBSJVERT I WSJTABSTOP, 112, 24 , 24 , 85
CONTROL "Sliderl", IDC_SLIDER5, "msct ls_t rackbar32 " , TBS_ΛUTOTICKS
TBSJVERT I WSJTABSTOP, 140, 24, 21, 85
LTEXT "Freq. ",-1,110,113,20,11 LTEXT "Q" . -1, 144, 113 ,8,11 GROUPBOX "High Cutoff ", -1,104, 15, 69, 111 CONTROL "Bypass", IDC_CHECK4, "Button" , BS_AUTOCHECKBOX |
WSJTABSTOP, 25, 136,40, 13
CONTROL "Bypass", IDC_CHECK5, "Bu ton" , BS_AUTOCHECKBOX |
WSJTABSTOP, 116, 136, 40, 13
CONTROL "Sliderl", IDC_SLIDER8, "msct ls_ rackbar32 " , TBS_AUTOTICKS
TBSJVERT I WSJTABSTOP, 203, 25, 24, 85
CONTROL "Sliderl", IDC_SLIDER9, "msctls_trackJbar32 " , TBS_AUTOTICKS
TBSJVERT I WSJTABSTOP, 231, 25, 21, 85
LTEXT "Freq. ".-1,201, 114, 20, 11 LTEXT "Q", -1,235, 114, 8, 11 GROUPBOX "New High Cutof f " , - 1 , 195 , 15 , 69 , 11 1 CONTROL "Bypass " , IDC_CHECK7 , " Button " , BS_AUTOCHECKBOX |
WSJTABSTOP, 207 , 137 , 40 , 13
END
IDD_PP9 DIALOG DISCARDABLE 0, 0, 244, 164 STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Resonance Compensation #2" FONT 8, "MS Sans Serif" BEGIN
CONTROL "Sliderl", IDCJSLIDER1, "msctls_trackbar32 " , TBS_ AUTOTICKS
TBSJVERT I WSJTABSTOP,20,24,20,85 CONTROL "Sliderl", IDCJSLIDER2, "msctls_trackbar32 " , TBS_ AUTOTICKS
TBSJVERT I WSJTABSTOP, 48, 24, 21, 85 CONTROL "Sliderl",IDC_SLIDER3, "msctls_trackbar32 " , TBS_AUTOTICKS
TBSJVERT I WSJTABSTOP, 76,24, 20, 85 LTEXT "Freq. " , IDC_STATIC, 17,113,20,11
LTEXT "Q",IDC_STATIC,51,113,8,11
LTEXT "Cut/Boost", IDC_STATIC, 71, 113, 33, 11
GROUPBOX "Third Notch", IDC_STATIC, 11, 15, 98, 111 CONTROL "Sliderl", IDC_SLIDER4, "msctls_trackbar32 " , TBS_ AUTOTICKS
TBSJVERT I WSJTABSTOP, 137, 24, 24, 85 CONTROL "Sliderl", IDC_SLIDER5, "msctls_trackbar32" ,TBS_AUTOTICKS
TBS_VERT I WSJTABSTOP, 165, 24,21, 85 CONTROL "Sliderl" , IDC_SLIDER6, "msctls_trackbar32 " , TBS_AUTOTICKS
TBSJVERT I WSJTABSTOP, 193, 24, 22, 85 LTEXT "Freq.",IDC_STATIC,13S,113,20.11
LTEXT "Q",IDC_STATIC.169,113,8,11
LTEXT "Cut/Boost", IDC_STATIC, 189, 113, 32, 11
GROUPBOX "Fourth Notch" , IDC_STATIC, 129, 15 , 98. Ill CONTROL "Bypaεs",IDC_CHECK5, "Button", BS_AUTOCHECKBOX |
WSJTABSTOP, 36,139,40,12 CONTROL "Bypaεε",IDC_CHECK6, "Button", BS_AUTOCHECKBOX |
WSJTABSTOP, 155, 139, 40, 12 END
IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 175, GG
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
FONT 8, "MS Sans Serif"
BEGIN
PUSHBUTTON "Cancel", IDCANCEL, 59, 34, 50, 14
LTEXT "Initializing I2C. Please Wait " , IDC_STATIC, 43 , 17,
98,8 END
IDD_DIALOG3 DIALOG DISCARDABLE 0 , 0 , 186 , 132
STYLE DS_MODALFRAME | WS_POPUP | WS CAPTION | WΞ_SYSMENU
CAPTION " Dialog "
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK", IDOK, 107, 95, 50, 14
CONTROL "COM1", IDCJRADIOl, "Button" , BS_AUTORADIOBUTTON, 23, 57, 36,
10
CONTROL "COM2", IDC RADI02 , " Button" , BS_AUTORADIOBUTTON, 23 , 70 , 36 , 10
CONTROL " COM3 " , IDC_RADI03 . " But on " . BΞ_AUTORADIOBUTTON . 23 , 82 , 3 G ,
10 CONTROL " COM4 " , IDC_RADI04 , " But t on " , BS_AUTORADIOBUTTON, 23 , 95 , 3 G ,
10 LTEXT "Choose COM port and reset DSP board" , IDC_STATIC, 28 , 21,
125, 8 GROUPBOX "COM Port", IDC STATIC, 15 , 5 , 60 , 69
END
IDD_DIALOG4 DIALOG DISCARDABLE 0, 186, 121
STYLE DS_MODALFRAME | WS_POPUP | WS CAPTION I WS SYSMENU
CAPTION "Dialog"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK", IDOK, 27, 72, 50, 14
PUSHBUTTON "Quit App",IDCjBUTTONl, 101, 72, 48, 14
LTEXT "I2C communication error ! " , IDC_STATIC, 49, 25, 79, 8
EDITTEXT IDC_EDIT1,49,42,68, 12, ES_AUTOHSCROLL END
IDD_PP10 DIALOG DISCARDABLE 0, 0, 187, 162
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Allpasε"
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "Sliderl", IDC_SLIDER1 "msct1s_trackbar32 " , TBS_AUTOTICKS
TBSJVERT I WSJTABSTOP 20,24,20, 85
CONTROL "Sliderl", IDC_SLIDER3 "msctls trackbar32",TBS AUTOTICKS
TBSJVERT I WSJTABSTOP, 50,24,20, 85
LTEXT "Freq. ",-1,17,113,20, 11
LTEXT "Q", -1,53, 113, 8, 8
GROUPBOX "Allpasε", -1, 11, 15, 70, 111
CONTROL "Bypass", IDC_CHECK1, "Button" , BS_AUTOCHECKBOX
WSJTABSTOP, 2S, 136, 37, 12 END
IDD_PP11 DIALOG DISCARDABLE 0, 0, 244, 159 STYLE WS_CHILD | WS_DISABLED | WS CAPTION CAPTION "Double-Tuned Notch" FONT 8, "MS Sans Serif" BEGIN
CONTROL "Sliderl", IDC_SLIDER1, "msctls_trackbar32" , TBS_AUTOTICKS
TBSJVERT I WSJTABSTOP, 20, 24, 20, 85
CONTROL "Sliderl", IDC_SLIDER2, "mεctlε_trackbar32" ,TBS_AUTOTICKS
TBSJVERT I WSJTABSTOP, 48, 24, 21, 85
LTEXT "Freq. ",-1,17, 113, 20, 11 LTEXT "Q", -1,51, 113, 8, 11 GROUPBOX "Notch", -1,11, 15, 70, 111 CONTROL "Sliderl", IDC_SLIDER5, "msctls_trackbar32" ,TBS_AUTOTICKS
TBSJVERT I WSJTABSTOP, 109, 24,21, 85
CONTROL "Sliderl", IDC_SLIDER6, "msctls_trackbar32" , TBS_AUTOTICKS
TBSJVERT I WSJTABSTOP, 137, 24, 22, 85
LTEXT "Q", -1,113, 113, 8, 11 LTEXT "Cut/Boost", -1,133,113,32,11 GROUPBOX "Compensation " , - 1 , 99 , 15 , 71 , 111 CONTROL "Bypass " , IDC_CHECK5 , "Button " , BS_AUTOCHECKBOX |
WSJTABSTOP, 73 , 136 , 39, 10
END
ff i fnde f _MAC II Ulll
II
II Vers ion
//
VS_VERSION_INFO VERSIONINFO FILEVERSION 0,7,4,0 PRODUCTVERSION 0,7,4,0 FILEFLAGSMAΞK 0x3fL ff i fde f DEBUG FILEFLAGS OxlL Seise
FILEFLAGS OxOL ffendif FILEOS OX4L FILETYPE OxlL FILESUBTYPE OxOL BEGIN
BLOCK "StringFilelnfo" BEGIN
BLOCK "O40904b0" BEGIN
VALUE "CompanyNa e" , "Pacific Microεonics lnc.\0" VALUE "FileDescription", "sa MFC Applicat on\0" VALUE "FileVerεion", "0, 7, 4, 0\0" VALUE "InternalName", "εa\0"
VALUE "LegalCopyright", "Copyright (C) PMI 1999\0" VALUE "OriginalFilename", "εa.EXE\0" VALUE "ProductName", "sa Application\0" VALUE "ProductVersion", "0, 7, 4, 0\0" END END
BLOCK "VarFilelnfo" BEGIN
VALUE "Translation", 0x409, 1200 END END ffendif // !_MAC
l/lll III II III II
II DESIGNINFO
// ffifdef APSTUDIO_INVOKED GUIDELINES DESIGNINFO DISCARDABLE BEGIN
IDD_ABOUTBOX, DIALOG BEGIN
LEFTMARGIN, 7 RIGHTMARGIN, 252 TOPMARGIN, 7 BOTTOMMARGIN, 48 END
IDD_SA_DIALOG, DIALOG BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 222
TOPMARGIN, 7
BOTTOMMARGIN, 168 END
IDD_DIALOGl, DIALOG BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 229
TOPMARGIN, 7
BOTTOMMARGIN, 222 END
IDD_PP1, DIALOG BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 188
TOPMARGIN, 7
BOTTOMMARGIN, 120 END
IDD PP2, DIALOG BEGIN
LEFTMARGIN, 7 RIGHTMARGIN, 281 TOPMARGIN, 7 BOTTOMMARGIN, 139
END
IDD_PP3, DIALOG
BEGIN
LEFTMARGIN, 7 RIGHTMARGIN, 188 TOPMARGIN, 7 BOTTOMMARGIN, 120
END
IDD_PP4, DIALOG
BEGIN
LEFTMARGIN, 7 RIGHTMARGIN, 237 TOPMARGIN, 7 BOTTOMMARGIN, 152
END
IDD_PP5, DIALOG
BEGIN
LEFTMARGIN, 7 RIGHTMARGIN, 332 TOPMARGIN, 7 BOTTOMMARGIN, 155
END
IDDJPP6, DIALOG
BEGIN
LEFTMARGIN, 7 RIGHTMARGIN, 180 TOPMARGIN, 7 BOTTOMMARGIN, 155
END
IDD_PP7, DIALOG
BEGIN
LEFTMARGIN, 7 RIGHTMARGIN, 235 TOPMARGIN, 7 BOTTOMMARGIN, 155
END
IDD_PP8, DIALOG
BEGIN
LEFTMARGIN, 7 RIGHTMARGIN, 278 TOPMARGIN, 7 BOTTOMMARGIN, 157
END
IDD_PP9, DIALOG
BEGIN
LEFTMARGIN, 7 RIGHTMARGIN, 237 TOPMARGIN, 7 BOTTOMMARGIN, 157
END
IDDJDIALOG2 , DIALOG
BEGIN
LEFTMARGIN, 7 RIGHTMARGIN, 1G8 TOPMARGIN, 7 BOTTOMMARGIN, 59
END
IDD DIALOG3, DIALOG 170
BEGIN
LEFTMARGIN, 7 RIGHTMARGIN, 179 TOPMARGIN, 7 BOTTOMMARGIN. 125
END
IDD_DIALOG4. DIALOG
BEGIN
LEFTMARGIN, 7 RIGHTMARGIN, 179 TOPMARGIN, 7 BOTTOMMARGIN, 114
END
IDD_PP10, DIALOG
BEGIN
LEFTMARGIN, 7 RIGHTMARGIN, 180 TOPMARGIN, 7 BOTTOMMARGIN, 155
END
IDD_PP11, DIALOG BEGIN
LEFTMARGIN, 7 RIGHTMARGIN, 237 TOPMARGIN, 7 BOTTOMMARGIN, 152 END END ffendif // APSTUDIO_INVOKED
II
II Menu
//
IDR_MENU1 MENU DISCARDABLE BEGIN
POPUP "File" BEGIN
MENUITEM "Open", ID_MENUITEM32771 MENUITEM "Save", ID_MENUITEM32772 MENUTTEM "Export Param File", ID FILE EXPORTPARAMFILE END END
Figure imgf000171_0001
If String Table
//
STRINGTABLE DISCARDABLE BEGIN
IDΞ_ABOUTBOX "tAbout KOJ'ε Amazing Town Crier. END
Sendif // English (U.S.) resourceε iim u ui iiiiiiiiiiiiiiiiiimiiiiiiiium ii mimiiiiiiim lUIIII
S i fndef APSTUDIO_INVOKED ui mm i/umiiuuimmiiium mm ui mini i mil
II
II Generated from the TEXTINCLUDE 3 resource -
//
Sdefine _AFX_NO_SPLITTER_RESOURCES
Sdefine AFX NO OLE RESOURCES Sdefine _AFXJNOJΓRACKERJRESOURCES
Sdefine _AFXJNO_PROPERTYJRESOURCES
Sif !de ined (AFX_RESOURCE_DLL) | | de ined (AFXJTARG_ENU) ffifdef JWIN32
LANGUAGE 9, 1
Spragma code_page (1252)
Sendif
Sinclude "res\εa.rc2" // non-Microsof Visual C++ edited resources
Sinclude "afxres. re" // Standard components
Sendif mi ii mimmiiiiii mm i mil ii mil ui mil
Sendif // not APSTUDIO INVOKED
opt cc, cex, ere, loc. so, mu, mex
DEFINE FAST ' 1 '
DEFINE MS63G2 '1'
TABLE_COUNTER EQU 10 RUN_COUNTER EQU 10 INIT_COUNTER EQU 10 org y(10) $100 org p(10) $980
SECTION SUPER
HDCD detect and expand code
include 'detect. asm' include 'expgain asm'
Adopted rom Motorola sample code .
page 132,60 include *ιoecru.aεm' include 'vectors .asm*
; include 'mbiquad.asm' include 'mpeq.asm' include 'mshelv asm' include 'mhipaεε .asm' include 'mlopaεε .asm' include ' allpasε. asm' list
CONFIGURE_ΞPI MACRO move )f0,x0 move x0,X-M_HSAR ; clear I2C address
M_HCKR bits 13:12 HFM1:0 noise filter setting (off) bit 1 CPOL bit 0 CPHA
00 xxxx xxxx xxOl move ffl.xO move ffO.xO move X0,X.M_HCKR commented out code should yeild a value of 0 for MJHCKR.
,- M_HCSR
, bit 13 12 HCSR HRIE bit 1 11 HCSR HTIE bit 1 10 HCSR HBIE bit 9 HCSR Idle (no care) bit 8 7 HRQE Host-request enable (asserted if ready to receive) bit 6 HMST Master mode (disabled) bit 5 HFIFO FIFO control (disabled) bit 4 HCKFR Clock freeze (off) bit 3 2 HM1 0 24 bit mode bit 1 HI2C Enables I2C mode bit 0 HEN Enable port ; XXOl OOIO OOOx 1001 move S$1209,x0 move x0, X M_HCSR
, set command to known value move SSPITXDEF.xO move X0,x εpixmit movep x εpixmit.x MJHTX
ENDM
CONFIGURE_I2C MACRO
, turn off port move S0,x0 move xO.X M HCSR
,- leave addresε alone move S0,x0 move x0,X M HSAR clear I2C address commented out code εhould yeild a value of 0 for MJHCKR. MJHCKR bits 13:12 HFM1:0 noiεe filter setting on
11 xxxx xxxx xxOO move #>$3000,x0 move x0,X:M HCKR
MJHCSR bit 13:12 HCSR HRIE bit 11 HCSR HTIE bit 10 HCSR HBIE bit 9 HCSR Idle (no care) bit 8.7 HRQE Host-request enable (asserted if ready to receive) bit 6 HMST Master mode (disabled) bit 5 HFIFO FIFO control (disabled) bit 4 HCKFR Clock freeze (off) bit 3:2 HM1:0 24 bit mode bit 1 HI2C Enables I2C mode bit 0 HEN Enable port xxOl 1100 lOlx 1010 move ff$lCAA,x0 move x0,X-M HCSR
,- set command to known value move f(0,xO move x0,x: εpixmit movep x:εpixmit,x:M_HTX
ENDM
XDEF fcontrol XREF HDCD_DETECT_INIT, HDCD_DETECT, lεbcntl XR£F ltemp, rtemp XREF dcontrol XREF HDCDJGAIN_INIT, HDCD_DYNAMICS XREF detect XREF r odel , bl tent 1
SPITXDEF equ $444444 org XI
DRX_BUFF_BASE ds 2
ARX BUFF BASE ds 2
TX BUFF BASE ds unprocessed followed by processed data
,RX_PTR ds TX PTR ds lags ds 1 sent ds 1
RightReceive equ 0
SPIReceive equ 1
SPIOverrun equ 2
SPIFIFOFull equ 3
SPIUnderrun equ 4
SPITransmit equ 5
SPIStateBit equ G spixmit ds 1 εpirecv ds 1 εhiεaveAl ds 1 εhiεaveXO ds 1 εhiεaveR4 ds 1 εhiεaveN4 ds 1
NADA ds 1 left ds 1 right ds 1 fcontrol ds 1 indexData ds 1 dpleft ds 1 dpright ds 1 stack ds 20
; interleaved delay line ; independently located org x(20) :$200 DELAYLEN EQU 128 2.9 mS delay line εdelayleft dsm DELAYLEN left εdelayright dsm DELAYLEN right org yi :
YNADA ds 1 volume ds 1 prefader ds 1 bypasε dε 1 hdcdbp dε 1 gainεcalebp ds 1 ddxco pbp ds 1 analogin ds 1 avolume ds 1 bypasεmask ds 1
BYPASS_ NOTCH1 EQU
BYPASS_ NOTCH2 EQU
BYPASS_ NOTCH3 EQU
BYPASS_ NOTCH4 EQU
BYPASS_ HIPASS EQU
BYPASS LOPASS EQU
BYPASS_ LOSHELV EQU
BYPASS_ HISHELV EQU
BYPASS CONECRY EQU 8
BYPASS_ ALLPASS EQU 9
BYPASS_ DBNOTCH EQU 10
BYPASS NLOPASS EQU 11 delayval dB
********* * ******* i *********************
EQ/filter declarations
******************* **************** smiley face shelf EQ ; left channel DECLARE_LSH 1L, 1.,- 0.867 DECLARE HSH 2L,1., -0.867
, right channel DECLAREJLSH 1R.1.,- 0.867 DECLARE HSH 2R.1., -0.867 resonance compensation PEQ .- left channel
DECLARE_PEQ 1L, 1 ,-0 9S10S65.0 72GS425
DECLARE_PEQ 2L, 1 ,-0 91,0.5
DECLARE_PEQ 6L, 1 ,-0.9510565,0 7265425 DECLARE_PEQ 7L, 1 ,-0 91,0 5
,- right channel DECLAREJPEQ 1R, 1. , - 0.91 , 0 5 DECLARE_PEQ 2R, 1. , - 0.91 , 0 5
DECLARE_PEQ 6R,l.,-0 9S1OS65.0 7265425 DECLARE_PEQ 7R, 1. , - 0.91 , 0 5
, standing wave re3ection PEQ , left channel
DECLARE_PEQ 3L, 1 ,-0 9999803,0 9g37365 DECLARE_PEQ 4L, 1. , -0.91 , 0 5 DECLARE_PEQ 5L,l.,-0 91,0 5
; right channel
DECLARE_PEQ 3R, 1., -0.9999803 , 0.9937365 DECLARE_PEQ 4R, 1. , -0.91, 0.5 DECLARE_PEQ 5R, 1. , -0.91 , 0.5
; hi and lo pass filters ,- left
DECLARE_HP hple , 0.0099733, 0.25 , 0.9987285 ; 70 Hz
DECLARE_LP Ipleft, 1.1921856, 0.6303886, 1.4112871 ; 14000 Hz / q = 0.22
; right
DECLARE_HP hpright, 0.0099733 , 0.25 , 0.9987285 , 70 Hz
DECLAREJLP Iprigh , 1.1921856, 0.6303886, 1.4112871 ; 14000 Hz
,- new lopass
; left
DECLARE_LP lpleft2, 1 - , 0. , 0.
; right
DECLAREJLP lpright2 , 1. , 0. , 0.
; allpass filters
DECLARE_AP aplef , -0.91, 0.5 DECLARE_AP apright, -0.91, 0.5
,- Keith new notch with 2 gain around it.
DECLAREJPEQ NT1L, 1. , -0.9999803 , 0.9937365 DECLARE_PEQ NT2L, 1. , -0.91, 0. S DECLARE_PEQ NT3L, 1. , -0.91, 0.5
DECLARE_PEQ NT1R, 1., -0.9999803 , 0.9937365 DECLARE_PEQ NT2R, 1. , -0.91, 0.5 DECLARE_PEQ NT3R, 1. , -0.91, 0.5
************ ************************* ******** org p:$100
START main ori #$03, mr mask interrupts movep #$0S000B,X M_PCTL move S0,omr movec #0,εp reset hardware stack pointer
, movep S$000003,x M_IPRP ESAI int's enabled and top Priority movep H$000007,X M_IPRP SHI (1) and ESAI (2) int's enabled move ((stack, r6 initialize stack pointer move S-l,m6 linear addressing move S0,x0 move X0, X • DRX_BUFFJBASE move χ0,x DRX_BUFF_BASE+1 move X0,X ARX BUFF BASE move xO.x ARXJBUFF_BASE+1 move XO.x TX_BUFF_BASE move XO. TX_BUFF_BASE+1 move xO.x TX_BUFF_BASE+2 move xO.x TX BUFF BA≤E+3 clr move a , x- lags move a,x sent
, HDCD decoder initialize move S>l,x0 move xO.x fcontrol move S>16, xO move x0,x lsbcntl jsr HDCD_DETECT_INIT move S>l,x0 move xO, x-dcontrol jsr HDCD_GAIN_INIT move S - 1 , O move 1,-1, ml move S-l,m2 move S-l,m3 move S-l,m4 move ff - 1 , m5 move S-l,m6 move #-l,m7 set up volume and bypass switches output volume is εet to zero so that filter parameterε can be downloaded, followed by volume being εet move #:>$800000,x0 move xO,y:volume move xO,y :prefader move xO,y:avolume move S>$7FFFFF,xO move xO,y:bypaεε move #>$0,x0 move xO,y:hdcdbp move xO,y.-gainscalebp move xO,y:ddxcompbp move x0,y:analogin move xO, y :bypaεsmaεk move xO,y :delayval move xO, x: indexData move #>εdelaylef ,xO move xO.x.-dpleft move S>εdelayτight,xO move xO,x:dpright
,- initialize EQ paramε
INIT_PEQ_PARAM 1L
INIT_PEQ_PARAM 1R
INIT_PEQ_PARAM 2L
INIT_PEQ_PARAM 2R
INIT_PEQ_PARAM 3L
INIT_PEQ_PARAM 3R
INIT_PEQ_PARAM 4L
I IT_PEQ_PARAM 4R
I IT_PEQ_PARAM 5L
INIT_PEQ_PARAM 5R
INIT_PEQ_PARAM 6L
IN IT_PEQ_PARAM 6R
INIT_PEQ_PARAM 7L
INIT_PEQ_PARAM 7R
INIT_PEQ_PARAM NT1L IN IT_PEQ_PARAM NT2L INIT PEQ PARAM NT3L 177
IN IT_PEQ_PAΛAM NT1R
IN IT_PEQ_P/UIAM NT2R
IN IT_PEQ_PARAM NT3 R
INIT_SH_PARAM 1L
I IT_SH_PΛRAM 1R
INIT_SH_PARAM 2L
INIT SH PARAM 2R
INIT_LP_PARAM Ipleft INIT LP PARAM Ipright
INIT_LP2_PARAM lpleft2 INIT_LP2_PARAM lpright2
INIT_AP_PARAM apleft INIT_AP_PARAM apright
; hi-pass does not need initializing as all params are downloaded
,- setup serial hoεt interface ; ; CONFIGURE_SPI CONFIGURE I2C
FST/FSR and SCKT/SCKR are generated from the PLD and fed to the DSP, A/D and D/A converters
;put esai in reset state.
IF ®DEFCANALOGIN')==0 movep #$000000, x:M_PCRC MLS 12/20/97 movep #$000000, x:M_PRRC MLS 12/20/97
ENDIF
movep S$Oc0200,x:MJTCCR FST is input (bit22=0) external clock source drives SCKT (bit21=0) negative FST polarity (bitl9=l) data & FST clocked out on rising edge (bitl8=l) 2 words per frame (bitl3:9=00001)
movep S$0c0200,x-M_RCCR , FSR is input (bit22=0)
.external clock source drives SCKR (bit21=0) .negative FSR polarity (bitl9=l)
.data fc FSR clocked in on rising edge (bitl8=0)BAK(121997) ,2 words per frame (bitl3 • 9=00001) movep #$000000. x M_SAICR movep S$dl7D03,x M_RCR ,RX1, RXO enabled (bitl 0=11) ,RX2, RX3 disabled !bιt3 2=00) , reserved (bιt5 4=00)
.MSB shifted first (bit6=0) .word left-aligned (blt7=0) .network mode (bιt9 8=01)
,32-bιt slot length, 24-bit word length (bltl4 10=11111) .word- length frame sync (bιtlS=0)
.frame sync occurs l clock cycle earlier (bιtl6=l) , reserved (bιtl9 17=000)
.RLIE, RIE, REIE enabled (bιt23 20=0101) ,bιt23 RLIE ,bιt22 RIE ,bιt21 REDIE ,bιt20 REIE movep #$dl3d00,x MJTCR ,MLS 12/20/97 TX0, TX1 enabled (bit3:0=0011) TX2, TX3, TX4, TX5 disabled
Figure imgf000179_0001
MSB shifted first (bit6=0) word left-aligned (bit7=0) network mode (bit9:8=01)
32-bit slot length, 24-bit word length (bitl4-10=lllll) word length frame sync (bitl5=0) frame sync occurs 1 clock cycle earlier (bitl6=0) reserved (bitl9:17=000)
TLIE, TIE, TEIE enabled (bit23:2O=O101) bit23 TLIE bit22 TIE ^ bit21 TEDIE ,bit20 TEIE movep ff$000edb,x:M_PCRC MLS 12/20/97 movep #$000edb,x-M PRR'C MLS 12/20/97 movep #$ffffff,x MJRSMA ,MLS 12/20/97 movep #$ffffff,x-M_RSMB , MLS 12/20/97 movep #$000003, x MJTSMA movep ff$000003,x:MJTSMB movep #$000000, x.MJTXO , zero out transmitter 0 movep #$000000, x:M_TXl ,- zero out transmitter 1 movep #$000000, X:M_TX2 , zero out transmitter 2 movep #$000000, .MJTX3 , zero out transmitter 3 bset #0,x:M_TCR ,-now enable TX0 bset #1,X:M_TCR ,now enable TX1 bset #2,x:M_TCR ,-now enable TX2 bset #3,X:M_TCR ;now enable TX3 bset #2,x.M RCR ;RE2 and TE3 must be set to enable
;TX3 and disable RX2
; turn on serial hoεt interface bset #0,X-M HCSR andi ff$FC,mr .enable all interrupt levels .clear scaling bits bclr #RightReceive,X flags jclr SRightReceive.X flags, bclr SRightReceive.X flags clr SRightReceive.X flags. move #>RX_BUFF_BASE, xO move x0,x RX_PTR move S>TX_BUFF_BASE, xO move x0,x TX PTR
Main loop LOOP jclr SRightReceive, X flags,- bclr SRightReceive, X flags btst #22, y analogin
IF <CC> move x DRXJBUFF_BASE, xO , receive left move x DRX_BUFF_BAΞE + 1 , xl , receive right
ELSE move x ARX_BUFFJBASE. xO .receive left move x ARXJBUFFJBASE + 1 , xl , receive right
E DI
, store unprocessed (with volume) output fust move y avolume,yO mpyr yO.xO.a mpyr yO,xl,b
, MM 5/20/99 Swapped channels tfr x0,a a,x TXJ3UFF_BASE+2 , transmit le t tfr xl,b b,x TX BUFF BASE .transmit right
,- write input into delay line move SDELAYLEN-l,mO move SDELAYLEN-l,ml move x-dpleft,rO move x-dpright, rl move y .delayval.yO move #>DELAYLEN, xO mpy x0, y0, a <r0) - move (rl) move a, no move a , nl move (rO+nO) move (rl+nl ) move #-l,mO move #-l,ml move rO.x.dpleft move rl,x:dpright
JSR STEREO PROCESS
; MM 5/20/99 Swapped channels move b,x:TX_BUFF_BASE+l .transmit left move a,x-TX BUFF BASE+3 .transmit right move #>l,x0 move x sent, a add xO,a move al,x:scnt don't saturate
3mp LOOP
; Subroutines STEREO PROCESS move a,x left move b,x right
, copy parameters from left channel EQs to right channel EQs COPY_SH_PARAM 1L, 1R COPY SH PARAM 2L.2R
COPY_PEQ_PARAM 1L, 1R
COPY_PEQ_PARAM 2L.2R
COPY_PEQ_PARAM 3L.3R
COPY_PEQ_PARAM 4L.4R
COPY_PEQ_PARAM SL.5R
COPY_PEQ_PARAM 6L.6R
COPY_PEQ_PARAM 7L.7R COPY_PEQ_PARAM NTIL.NTIR COPY_PEQ_PARAM NT2L. NT2R COPY PEQ PARAM NT3L, NT3R
COPY_HP_PARAM hpleft, hpright COPY_LP_PARAM Ipleft, Ipright COPY LP PARAM Ipleft2, lpπght2
COPY_AP_PARAM aple t , aprlght
, HDCD processing jset #22, y hdcdbp.doeq move x- left, a move x-right , b move a,x : lte p move b,x- rtemp clr b move #>l,x0 move y:gainscalebp, a tst a teq xO,b move bl,x-. dcontrol sr HDCD DETECT
; destroy code move #>3,x0 move x:rmodel,a cmp xO,a bne εkip_code_dest move #>8,x0 move x:bitcntl,a cmp xO,a bne skip_code_dest move x: ltemp, a eor #>$000100,a move a,x: ltemp move a,x:left εkip_code_dest : move #-l,m0 move #-l,m4 move #4,n4 jεr HDCD_DYNAMICS move x: ltemp, a move x:rtemp,b btst #22,y:hdcdbp
. IF cCC> move a,x:left move b, x:right move x detect, O move xO, x: spixmit
ELSE move #0,x0 move xO, x: spixmit
ENDI jmp doeql
;doeq move #0,x0 move xO,x spixmit doeql j set #22, y bypaεs,dopoεtvol move x left.xl move x: right, yl move y: re fader, xO mpyr -xO,xl,a mpyr -xO.yl.b tfr a,b b,x:right
; smiley face j set SBYPASS_LOSHELV,y:bypassmask,_εkiplsl
LSH 1L _εkiplsl jεet BYPASSJHISHELV, y :bypasεmask,_εkiphsl
HSH 2L _εkiphsl
; cut-off response jset #BYPASSJHIPASS,y :bypassmaεk,_skiphpl
HP hpleft _skiphpl jεet #BYPASS_LOPASS,y:bypaεεmask,_skiplpl
LP Ipleft _εkiplpl jset #BYPASSJNLOPASS,y:bypaεεmask,_εkiplp21
LP lpleft2 _skiplp21
; resonance EQ jεet #BYPASS_NOTCHl,y:bypassmask,_εkipll
PEQ 1L _skipll jset #BYPASS_NOTCH2,y:bypasεmask,_εkip21
PEQ 2L _skip21 jset #BYPASS_NOTCH3,y:bypassmask,_skip31
PEQ 6L _skip31 jεet #BYPASS_NOTCH4,y:bypassmaεk,_εkip41
PEQ 7L _εkip41
; cone-cry jεet #BYPASS_CONECRY,y:bypassmask, _εkipccl
PEQ SL
PEQ 3L
PEQ _εkipccl
; double-tuned notch jset ffBYPASS_DBNOTCH,y:bypassmask,_εkipdbnl
PEQ NT1L
PEQ NT2L
PEQ NT3L _εkipdbnl
,- all-paεε jεet #BYPASΞ_ALLPASS,y:bypasεmaεk,_εkipapl
AP apleft _skipapl move b,x:left move x: right, b
; smiley face jset #BYPASSJLOSHELV,y:bypasεmask,_skiplεr
LSH 1R skiplsr jset SBYPASSJHISHELV, y: bypassmask, _skiphsr
HSH 2R _skiphsr
; cut-off response jset SBYPASS_HIPASS,y :bypassmaεk,_skiphpr
HP hpright _skiphpr jset SBYPASS_LOPASS, y : bypassmask, _εkiplpr
LP Ipright _skiplpr εet SBYPASS_NLOPASS,y : bypasεmask, _βkiplp2r LP lpright2 _εkiplp2r
; resonance EQ j set S BYPASS roτCHl , y : bypasεmask, _εkiplr
PEQ 1 R _εkipl r set #BYPΛSS_NOTCH2,y .bypassmask, _εkip2r
PEQ 2R _εkip2r jset #BYPASSJNOTCH3,y:bypassmask,_skip3r
PEQ 6R _skip3r jset SBYPASS_NOTCH4 , y :bypassmas , _skip4r
PEQ 7R _skip4r
; cone -cry jset SB PASS_CONECRY,y : bypassmask, _skipccr
PEQ 5R
PEQ 3R
PEQ 4R _εkipccr
; double-tuned notch jεet #BYPASS_DBNOTCH,y:bypassmaεk,_skipdbnr
PEQ NT1R
PEQ NT2R
PEQ NT3R _εkipdbnr
,- all-pass jεet #BYPASS_ALLPASS,y:bypassmask,_skipapr
AP apright _skipapr move b,x: right dopostvol :
plainvol : move y.-volume, yO move X: left, xO move x- right, xl mpyr -xO,y0, a mpyr -xl ,y0, b org yi
org p
SHI interrupts
--- SHI/I2C receive ISR shi_rx_iεr move al,x shiεaveAl move xθ,x shiεaveXO move r4 , x εhιεaveR4 move n4 , x shιεaveN4 movep x MJHRX.al j εet #SPIStateB t,x lags ,_gotData
, got index move al.x indexData bset SSPIStateBit, x flags j p _exιtlnt
, got data gotData move x ιndexData,n4 move Sppt rs, r4 1/119
184 bclr SSPIStateBit , x flags movem p (r4+n4) r4 move a] L,y (r4> exitlnt move x εhiεaveAl, al move X shiεaveXO, xO move X εhιsaveR4 , , r4 move X εhιsaveN , ,n4
Figure imgf000185_0001
, SHI/I2C receive overrun error shι_rxe_ιsr movep x M_HCSR,x NADA movep x M_HRX,x NADA bset SSPIOverrun.x flags bclr SSPIStateBit, x flags
Figure imgf000185_0002
SHI Receive FIFO Full movep X MJHCSR.x NADA movep X MJHRX.X NADA bset #SPIFIFOFull, x- lags bclr SSPIStateBit, x. flags
Figure imgf000185_0003
SHI Transmit Data εhi_txu_isr , SHI Transmit Undernin Error bset #SPIUnderrun, x flags movep X MJHCSR. x-NADA movep x spixmit, x M_HTX bclr SSPIStateBit , x . flags rti εhi_tx_ιsr movep x spixmit.x MJHTX bset SSPITransmit , x flags
Figure imgf000185_0004
;SHI Bus Error εhi_bus_error
; movep x M_HCSR,X-NADA
; bset #SPIReceιve+4 , x flags
; reset shi bclr #0,x M_HCSR nop nop bset #0,x MJHCSR bclr SSPIStateBit, x-:flags nop rti
, Subroutines include 'ιsr_dig asm'
Interrupt Service Routines
esaι_txe_ιsr ESAI TRANSMIT ISR bclr #14, x M SAISR Read SAISR to clear transmit underrun error flag esaι_tx_ιsr jset S13 x M_SAISR,TxLe tSlot movep x TX_BUFF_BASE+2 x MJTX1 , write unprocessed data movep x TXJBUFFJBASE+3,x MJTXO movep x TX BUFF BASE+3 X M TX2 movep X : TX_BUFF_BASE+ 3 , x : MJTX3 rt i
TxLef tSlot movep x : TXJBUFF_BΛSE, x : MJTXl write unprocessed data movep x : TX_BUFF_BASE+ l . X : M_TX0 movep x : TX_BUFFJBASE + l , x : MJTX2 movep X: TXJBUFFJBASE+1 , x : MJTX3 rt i
Ξsai_txlε_iεr ESAI TRANSMIT LAST SLOT ISR move rO, X: (rG) + Save rO to the stack move #TX_BUFF_BASE rO Reset pointer move r0,x:TX_PTR Reset tx buffer pointer just in caεe it was corrupted
; move x:- (r6) ,r0 Restore rO rti esaι_rxe_ιsr ; ESAI RECEIVE ISR bclr #7,X:M_SAISR ; Read SAISR to clear receive overrun error flag
; overrun error flag esai rx isr jset #$6,X:M_SAISR,LeftSlot bεet SRightReceive, : flags ; if right channel data then set flag movep X:M_RXO,x:ARXJBUFF_BASE+l movep X:M_RXl,x:DRX_BUFF_BASE+l rti
LeftΞlot movep X:MJRXO, x:ARX_BUFF_BASE movep x:MJRX1 , x.- DRXJBUFF_BASE rti esai_rxlε_isr ESAI RECEIVE LAST SLOT ISR
; move r0,x: (r6) + Save rO to the εtack move #RX_BUFFJBASE, r0 Reεet rx buffer pointer just in case it was corrupted
; move rO,X:RX_PTR Update rx buffer pointer
; move X:-(r6),rO Restore rO rti variable look up table pptrs dc volume dc εh_gamma 1L dc εh_k_lL dc εh_gamma_2L dc εh_k_2L dc peq_gamma_lL dc peq_beta_lL dc peq_k_lL dc peq_gamma_2 dc peq_beta_2L dc peq_k_2L dc peq_gamma_3L dc peq_beta_3L dc peq_k_3L dc peq_gamma_4L dc peq_beta_4L dc peq_k 4L dc peq_gamma 5L dc peq_beta_5L dc peq_k_SL dc prefader dc bypass dc hp_scale_hplef dc hp_fcjhpleft dc hp_qc_hpleft dc lp_εcale_lpleft dc lp_a2_lpleft dc lp_al_lplef dc hdcdbp dc gainscalebp dc ddxcompbp dc peq gamma 6L dc peq_beta_6L dc peq_k 6L dc peq_gamm _7 dc peq_beta_7L dc peq_k 7L dc analogin dc avolume dc bypassmask dc delayval dc ap_gamma apleft dc ap_beta_apleft dc lp_εcale_lpleft2 dc Ip_a2_lpleft2 dc lp_al_lpleft2 dc Ip_b2_lpleft2 dc lp_bl_lpleft2 dc peqjgamma NT1L dc peq_beta_NTlL dc peq_k NT1L dc peq_gamma NT2L dc peq_betaJNT2L dc peq_k_NT2L dc peq_gamma_NT3 dc peq_beta_NT3L dc peq_k_NT3L dc YNADA dc YNADA dc YNADA
ENDSEC
end
SH_SCALE_FACTOR EQU 3
SH_SCALE_DIVIDE EQU ( 1< <SH_SCALE_FACTOR)
k = 0 => lo/hi pasε filter
0 < k < 1 => cut k = 1 => pass- thru k > 1 => boost gamma drives critical frequency
DECLARE LSH MACRO name, , gamma
Figure imgf000188_0001
org yi : sh_gamma_\name dc gamma εh_mιnuε_oneJ\name dc -1.0 sh_k_\name dc k/SH_SCALE_ DIVIDE sh I \name dc l./SH SCALE _DIVIDE
ENDM DECLAREJHSH MACRO name, k, gamma DECLAREJLSH name , k, gamma ENDM
COPY SH PARAM MACRO from, to move y: sh_gamma_\from, O move X0,y- sh_gammaJ\to move y: sh_k_\from,x0 move x0,y:sh_k_\to
ENDM
INIT SH PARAM MACRO move #>(-1.0) ,x0 move xO, y: εh_minuε_one_\name move #> (1 /SH_SCALE_DIVIDE) ,X0 move xO,y:εh_k_\name move xO,y: εh_l_\name
ENDM
input data is in xO input is scaled by 0 5 to prevent internal clipping in the all-pass computes all-pass. y(n) = - gamma * x(n) - x(n-l) - gamma * y(n-l) (lo-ahelv) y(n) = gamma * x(n) + x(n-l) - gamma * y(n-l) (hi-εhelv) all-pass output is scaled by gam- output = (ϋ+k)/2) * x(n) + !(l-k)/2) * y(n) assumes mO ,m4 , m5 = - 1 MACRO name asr b #sh gamma_\ιname . r4 rnd b #sh x \name , rO move b,xO y: (r4) +,y0
; compute y(n) mpy -xO, yO, ,b x : (rO) +, xl y: (r4) +,yl mac xl,yl,b x: (rO) -,xl macr -yO.xl.b x0,x:(rO)+ y:(r4)+,y0
; all-pass output in b now scale by gain/cut factor mpy x0,y0,b b.x: (rO) - b,yl mac -yl.yO.b y: (r4) +,y0 mac xO.yO.b mac yl.yO.b
,- now scale output to get real result asl #(SH_SCALE_FACTOR) ,b,b rnd b
ENDM MACRO asr b #sh_garπma_\name, r4 rnd b sh_x_\name, rO move b,x0 y: (r4) +,y0
,- compute y(n) mpy x0,y0,b x: (rO)+,xl y: (r4)+,yl mac -xl,yl,b x: (rO) -,xl macr -yO,xl,b xO,x:(rO)+ y:(r4)+,y0
; all-pass output in b now scale by gain/cut factor mpy xO , yO , b b,x:(rO)- b,yl mac -yl,y0,b y: (r4) +,y0 mac x0,y0,b mac yl,yO,b
,- now scale output to get real result asl # (SH_SCALE_FACTOR) , b, b rnd b
ENDM
189
PEQ_SCALE_FACTOR EQU 3
PEQ_SCALE_DIVIDE EQU ( 1< < PEQ_SCALE_FACTOR)
k is gain k = 0 => notch filter
0 < k < l => cut k = 1 => pass-thru k > 1 => boost gamma drives critical frequency beta defines Q
DECLARE PEQ MACRO name, k, gamma , beta
Figure imgf000190_0001
peq_x_\name dc 0 dc 0 org yi: peq_gamma_\name dc gamma peq_betaj\name dc beta peq_k_\name dc k/PEQ_SCALE_DIVIDE peq_l_\name dc 1. /PEQJSCALEJDIVIDE peq_v_\name dc 0 peq_w \name dc 0
ENDM
COPY PEQ PARAM MACRO rom, o move y peq_gamma_\from, xO move xO , y. peq_gamma_\to move y : peq_beta_\from, xO move xO , y. peq_beta_\to move y peq_kjfrom,x0 move x0,y:peq_k_\to
ENDM
INIT PEQ PARAM MACRO IVIDE) , xO
Figure imgf000190_0002
ENDM
input data is in b input is scaled by 0.5 to prevent internal clipping in the all-pass computes all-paεε: v(n) = gamma * y(n-l) + y(n-2) - gamma * v(n-l) w(n) = gamma * x(n-l) + x(n-2) - gamma * w(n-l) y(n) = w(n) + beta * x(n) - beta * v(n) all-pass output is scaled by gain. output = ((l+k)/2) * x(n) + ((l-k)/2) * y(n) assumes mo, m , m5 = - 1 PEQ MACRO asr b Speq_y_\name, rO move #peq_gamma_\name, r move #peq_v_\name , r5 move b,xO move x (rO) +, a <r4) +, yO move x (rO)+,xl (r5)+, yi
, compute v (n) mac xl,yO,a x (rO)+,b mac -yl,yO,a x (rO) ,xl y (r5) ,yl
, compute w(n), v(n) IS now m a mac xl.yO.b a, xl a, y (r S) + mac -yl.yO b x (rO) , a y <r4) + .yθ
, compute y(n), w(n) is now in b mac -xl.yO.b xO.x (r0)- b, y (r 5)- mac xO,y0,b a,x (rO) - y (r4) + ,yθ
, all-pass output m b, n/cut fact mpy x0,y0,b (rO) b. yi mac -yl.yO.b y (r4) + ,yθ mac xO,yO,b a,x (r0)+ mac yl,yO,b yl,x (rO)-
, now scale output to get real result asl # ( PEQ_SCALE_FACTOR) , b, b rnd b
ENDM
LP_SCALE_FACTOR EQU 6
LP_SCALE_DIVIDE EQU ( 1<<LP_ΞCALE_FACT0R)
modified chamberlm lo-pass (both x(n) and x(n-l)) q also defines gam input is scaled to avoid internal clipping f = 2*sm(w/2) f only valid when less than 1
0 q < 1 implemented as a direct form biquad with coefficients and data scaled needs headroom for gain
DECLARE LP MACRO name, cal, ca2, cb org xi : lp_w_\name ds org yi : lp_scale_\name dc cb/16. lp_a2_\name dc ca2/2. lp_al_\name dc cal/2 lp_b2_\name dc 0 0 lp_blj\name dc 1.0/2.
ENDM
COPY LP PARAM MACRO from, o move y lp_scale_\from, xO
Figure imgf000192_0001
ENDM
INIT LP PARAM MACRO move #0,x0 move x0,y lp_b2_\name move x0,y lp_a2_\name move x0,y lp_al_\name move x0,y lp_bl_\name move #>(i /16 ) ,x0 move x0,y lp_scale_\name
ENDM
INIT LP2 PARAM MACRO move SO.xO move xO, y lp_a2J\name move x0 , y lp_al \name move #>o 5 , x0 move x0 , y lp_b2_\name move S>1 , x0 move x0 , y lp_blj\name move #> (0.25/16.) ,X0 move xO,y:lp_scale \name
assumes : mO , m4 , m5 = - 1
MACRO name move b,x0 ori #8,mr move #lp_εcale _\name, r4 move #lp_w name , rO move y (r4) + yo¬ xO = x(n) , yO = 0.5 mpy x0,y0,b x: (rO) +,x0 y (r4) + yo O = w(n-2) , yO = a2 mac -x0,y0,b X: (rO) -,xl y (r4) + yO xl = W(n-l) , yO = al macr -xl,y0.b xl, : (rO) + y (r4) + yO w(n-2) = w(n-l) , yO = b2 mac xO, y0,b b,x: (rO) - y (r4) + yO w(n-l) = a, yO = bl macr l.yO.b andi #$F7,mr asl #4,b,b
ENDM
HP_SCALE_FACTOR EQU 6
HP_SCALE_DIVIDE EQU ( 1<<HP_SCALE_FACT0R)
chamberlm hi-pass (from lopass) q also defines ga input is scaled to avoid internal clipping f = 2*sιn(w/2) f only valid when less than 1
0 < q < 1 implemented aε a direct form biquad with coefficients and data scaled needs headroom for gam
DECLARE_HP MACRO name , fc, c, scale org xi • hp_s2_\name ds 1 hp_y \name ds 1 org yi : hp_scale_\name dc (-0 5*scale) hp_fc_\name dc fc hp_qc_\name dc qc
ENDM
COPY_HP_PARAM MACRO from, to move y hp_εcale_\from, xO move xO,y-hp_εcale_\to move y hp_fc_\from, xO move xO,y-hp_fc_\to move y : hp_qc_\from, xO move x0,y hp_qc_\to
ENDM
assumes : mO , m4 , m5
HP MACRO name move #hp_scale_\name,r4 move #hp_ε2_\name, rO move b,x0 y (r4)+,y0 , yO = scale
, a = x(n) * scale mpy -y0,x0,a x (r0)+,xl y (r4)+,y0 , yO = fc
, b = s2(n-l) * fc mpyr xl,y0,b x (r0),x0 y (r4)+,yl , yl = qc
, b = s2(n-l) * fc + y(n-l) add xO,b
, a = x(n) - s2(n-l) * fc - y(n-l) εub b,a b, x (rO)
, a = sl(n) = x(n) - s2(n-l) * fc - y(n-l) - qc * s2(n-l) macr -xl.yl.a xl , b move a,xO
, b = s2(n) = s2(n-l) + fc * sl(n) macr x0,y0,b x (rθ)-.xθ IF βDEFCLO') tfr xO.b (rO) ELSE tfr a.b b,χ: (rO)
ENDIF asl b
ENDM
1/11918
195
AP_SCALE_FACTOR EQU 3
AP_SCALE_DIVIDE EQU ( 1< <AP_SCALE_FACTOR)
gamma drives critical frequency beta defines Q
DECLARE AP MACRO name, amma, beta
Figure imgf000196_0001
ap_x__\name dc 0 dc 0 org yi : ap_gamma_\name dc gamma ap_beta_\name dc beta ap_vj\name dc 0 ap w_\name dc 0
ENDM
COPY AP PARAM MACRO from, to move y:ap_gamma_\ rom, xO move xO , y: ap_gamma_\to move y: ap_beta_\from,xO move xO , y : ap_beta_\to
ENDM
INIT_AP_PARAM MACRO ENDM
input data is in b input is scaled by 0.5 to prevent internal clipping in the all-pass computes all-pass: v(n) = gamma * y(n-l) + y(n-2) - gamma * v(n-l) w(n) = gamma * x(n-l) + x(n-2) - gamma * w(n-l) y(n) = w(n) + beta * x(n) - beta * v(n) assumes: mO, m4 , m5 -1
AP MACRO asr b #aρ_y_\ιname, rO move #ap gamma \name,r4 move #ap !V_ name, r5 move b,xO move x: (rO) +, a y- : (r4) +,y0 move x: (rO) +, xl y- . (rS) +,yl
; compute v(π) mac xl,yO,a x: (r0)+,b mac -yl.yO, a X: (rO) ,xl y- . (r5) -,yl
,- corrrpute w (n) , v(n) is now in a mac xl.yO.b a, xl a. y.- (r5) + mac -yl.yO, b x: (rO) , a y: : (r4) +, yO
; compute y (n) , w(n) is now in b mac -xl.yO, b xO.x: (rO) - b, y: (r5) - mac xO.yO.b a, x: (rO) - asl : (rO) -, a rnd b.yl a, x. (rO) + move yl. x: (rO) -
ENDM
include

Claims

WHAT IS CLAIMED IS:
1. An apparatus for modifying an electrical audio signal for input to a sonic reproduction device characterized by a plurality of individual responses which in combination define an overall response for the sonic reproduction device, each individual response comprising at least one of a frequency, time, phase or transient response, said apparatus comprising: a plurality of modification filters having modification responses that simulate the plurality of individual responses, the modification filters for receiving the electrical audio signal, modifying the electrical audio signal and providing the electrical audio signal to the sonic reproduction device; and a plurality of adjustable parameters, each associated with at least one of the modification filters for allowing adjustments to the responses of the modification filters; wherein the adjustments create a plurality of individual conjugate responses, each individual conjugate response associated with at least one of the plurality of individual responses.
2. The apparatus of claim 1 wherein the plurality of individual responses of the sonic reproduction device are related to at least one of mechanical, acoustic and electromagnetic behavior of the sonic reproduction device.
3. The apparatus of claim 1 wherein the filters are defined by digital signal processes.
4. The apparatus of claim 1 wherein the filters are defined by analog circuitry.
5. The apparatus of claim 1 wherein the plurality of modification filters are non-interacting.
6. The apparatus of claim 1 wherein the plurality of modification responses combine to form an overall response that is a conjugate to the overall response for the sonic reproduction device.
7. The apparatus of claim 1 wherein at least one of the modification filters comprises a cut-off filter and the parameters for adjusting the frequency response of the cut-off filter comprise peak frequency, amplitude and Q parameters.
8. The apparatus of claim 7 wherein the peak frequency, amplitude and Q parameters modify the frequency response of the cut-off filter in at least one of the low and high frequency ranges.
9. The apparatus of claim 1 wherein at least one of the modification filters comprises a constant slope equalizer and the parameters for adjusting the frequency response of the constant slope equalizer comprise crossover frequency and boost shelf parameters.
10. The apparatus of claim 9 wherein the crossover frequency and boost shelf parameters modify the frequency response of the constant slope equalizer in at least one of the low and high frequency ranges.
11. The apparatus of claim 1 wherein at least one of the modification filters comprises a parametric notch filter and the parameters for adjusting the frequency response of the parametric notch filter comprise notch frequency, amplitude and Q parameters.
12. The apparatus of claim 1 wherein at least one of the modification filters comprises a parametric notch-boost filter and the parameters for adjusting the frequency response of the parametric notch-boost filter comprise notch frequency, amplitude and Q parameters.
13. A sound compensation system for altering an electrical audio signal for input to a sonic reproduction device having associated behavioral characteristics, said system comprising: a model of the sonic reproduction device having a plurality of filters that simulate at least one of the behavioral characteristics of the sonic reproduction device, each filter having an associated response that combine to define an overall response for the model, each response comprising at least one of a frequency, time, phase or transient response; and a controller that modifies the response of each of the plurality of filters to transform the filter into a conjugate filter having a responses that is a conjugate to the original response of the filter.
14. The system of claim 13 wherein the behavioral characteristics are defined by individual components of the sonic reproduction device
15. The system of claim 13 wherein the behavioral characteristics are defined by groups of individual components of the sonic reproduction device
16. The system of claim 13 wherein the filters are defined by digital signal processes and the controller comprises a computer
17. The system of claim 13 wherein the filters are defined by analog circuits and the controller comprises adjustable circuit components
18. The system of claim 13 wherein the sonic reproduction device comprises a speaker and at least one of the plurality of filters comprises at least one associated adjustable parameter and the value of the parameter is calculated based on physical characteristics of the speaker.
19. The system of claim 18 wherein the physical characteristics of the speaker comprises at least on of cone and coil mass, air volume, mechanical compliance, radiating area, damping, moving mass and motor characteristics.
20. The system of claim 13 wherein the sonic reproduction device comprises a speaker and at least one of the plurality of filters comprises at least one associated adjustable parameter and the value of the parameter is derived from a standard speaker model.
21. The system of claim 13 wherein at least one of the plurality of filters has at least one associated adjustable parameter and the value of the parameter is determined experimentally using standard test measurements.
22. The system of claim 13 wherein the controller is configured such that an adjustment in the setting of one parameter modulates the setting of at least one other parameter.
23. The system of claim 22 wherein the sonic reproduction device comprises a speaker and the one parameter that modulates the at least one other parameter relates to the magnet structure and voice coil of the speaker.
24. The system of claim 13 wherein the controller monitors the program conditions at the sonic reproduction device and sets at least one of the parameter values based on the program conditions.
25. The system of claim 24 wherein the program conditions comprise at least one of volume control settings, program level and bass content.
26. The system of claim 13 wherein one of the filters comprises a weighted compensation notch filter.
27. The system of claim 26 wherein the filter comprises a single-tuned weighted compensation notch.
28. The system of claim 26 wherein the filter comprises a double-tuned weighted compensation notch.
29. A sound system comprising: a sonic reproduction device having associated mechanical, acoustic and electromagnetic behavioral characteristics; a source for outputting an electrical audio signal to a model of the sonic reproduction device, the model having a plurality of filters that simulate at least one of the mechanical, acoustic and electromagnetic behavioral characteristics of the sonic reproduction device, each filter having an associated response comprising at least one of a frequency, time, phase or transient response, the model outputting the electrical audio signal to the sonic reproduction device; and a controller that modifies the responses of the filters to transform the model into a conjugate model having a plurality or niters wun responses iπai compose conjugates to the original response of the filter.
30. The system of claim 29 wherein the filters are defined by digital signal processes.
31. The system of claim 29 wherein the filters are defined by analog circuitry.
32. The system of claim 29 wherein the plurality of filters are non-interacting.
33. The system of claim 29 wherein at least one of the filters comprises a cutoff filter and modifications to the frequency response of the cut-off filter comprise adjustments to peak frequency, amplitude and Q.
34. The system of claim 29 wherein at least one of the filters comprises a constant slope equalizer and modifications to the frequency response of the constant slope equalizer comprise adjustments to crossover frequency and boost shelf.
35. The system of claim 29 wherein at least one of the filters comprises a parametric notch filter and modifications to the frequency response of the parametric notch filter comprise adjustments to notch frequency, amplitude and Q.
36. The system of claim 29 wherein at least one of the filters comprises a parametric notch-boost filter and modifications to the frequency response of the parametric notch-boost filter comprise adjustments to notch frequency, amplitude and Q.
37. A method for modifying an electrical audio signal for input to a sonic reproduction device characterized by a plurality of individual responses which in combination define an overall response for the sonic reproduction device, each individual response comprising at least one of a frequency, time, phase or transient response, said method comprising the steps of: simulating the plurality of individual responses with a plurality of filters; adjusting the responses of the plurality of filters such that, for each filter, the adjusted response comprises a response that is a conjugate to one of the individual responses; inputting the electrical audio signal to the filters.
38. The method of claim 37 wherein the plurality of individual responses of the sonic reproduction device are related to at least one of a mechanical, acoustic and electromagnetic behavior of the sonic reproduction device.
39. The method of claim 37 wherein the plurality of filters are non- interacting.
40. The method of claim 37 wherein the plurality of adjusted responses combine to form an overall response that is a conjugate to the overall response for the sonic reproduction device.
41. The method of claim 37 wherein at least one of the filters comprises a cut-off filter and the step of adjusting the frequency response of the cut-off filter comprises the step of setting at least one of peak frequency, amplitude and Q.
42. The method of claim 37 wherein at least one of the filters comprises a constant slope equalizer and the step of adjusting the frequency response of the constant slope equalizer comprises the step of setting at least one of crossover frequency and boost shelf.
43. The method of claim 37 wherein at least one of the filters comprises a parametric notch filter and the step of adjusting the frequency response of the parametric notch filter comprises the step of setting at least one of notch frequency, amplitude and Q-
44. The method of claim 37 wherein at least one of the filters comprises a parametric notch-boost filter and the step of adjusting the frequency response of the parametric notch-boost filter comprises the step of setting at least one of notch frequency, amplitude and Q.
45. A method of altering an electrical audio signal for input to a sonic reproduction device having associated behavioral characteristics, said method comprising the steps of: simulating at least one of the behavioral characteristics of the sonic reproduction 5 device with a plurality ol hlters, each filter having an associateα response comprising at least one of a frequency, time, phase or transient response; and for each of the filters, modifying the response of the filter to transform the filter into a conjugate filter having a response that comprises a conjugate to the original response of the filter.
46. The method of claim 45 wherein the behavioral characteristics are defined by individual components of the sonic reproduction device.
47. The method of claim 45 wherein the behavioral characteristics are defined by groups of individual components of the sonic reproduction device.
48. The method of claim 45 wherein the sonic reproduction device comprises a speaker and at least one of the plurality of filters has at least one associated adjustable parameter and the step of modifying the response of the filter comprises the steps of: calculating the value of the at least one adjustable parameter value based on the physical characteristics of the speaker; and setting the parameter to the calculated value.
49. The method of claim 48 wherein the physical characteristics of the speaker comprises at least on of cone and coil mass, air volume, mechanical compliance, radiating area, damping, moving mass and motor characteristics.
50. The method of claim 45 wherein the sonic reproduction device comprises a speaker and at least one of the plurality of filters has at least one associated adjustable parameter and the step of modifying the response of the filter comprises the steps of: deriving the at least one adjustable parameter from a standard speaker model; and setting the parameter to the derived value.
51. The method of claim 45 wherein at least one of the plurality of filters has at least one associated adjustable parameter and the step of modifying the response of the filter comprises the steps of: determining the at least one adjustable parameter experimentally using standard test measurements; and setting the parameter to the determined value.
52. The method of claim 48, 50 or 51 further comprising the step of modulating the setting of at least one parameter in response to the setting of another parameter.
53. The method of claim 48, 50 or 51 further comprising the steps of: monitoring at least one program condition at the sonic reproduction device; and setting at least one of the parameter values based on the at least one program condition.
54. The method of claim 53 wherein the program conditions comprise at least one of volume control settings, program level and bass content.
PCT/US2000/021916 1999-08-11 2000-08-10 Compensation system and method for sound reproduction WO2001011918A2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2001515654A JP2003506984A (en) 1999-08-11 2000-08-10 Compensation system and compensation method for sound reproduction
AU69009/00A AU6900900A (en) 1999-08-11 2000-08-10 Compensation system and method for sound reproduction

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US14841299P 1999-08-11 1999-08-11
US60/148,412 1999-08-11

Publications (2)

Publication Number Publication Date
WO2001011918A2 true WO2001011918A2 (en) 2001-02-15
WO2001011918A3 WO2001011918A3 (en) 2001-11-15

Family

ID=22525663

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/US2000/021916 WO2001011918A2 (en) 1999-08-11 2000-08-10 Compensation system and method for sound reproduction

Country Status (6)

Country Link
JP (1) JP2003506984A (en)
CN (2) CN101883304B (en)
AU (1) AU6900900A (en)
MY (1) MY131348A (en)
TW (1) TW479437B (en)
WO (1) WO2001011918A2 (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2431527A (en) * 2005-10-20 2007-04-25 Nicholas Palmes Bray Electrified gate
US7497003B2 (en) 2002-03-29 2009-03-03 Panasonic Corporation Apparatus and method for supporting speaker design, and program therefor
US8094827B2 (en) 2004-07-20 2012-01-10 Pioneer Corporation Sound reproducing apparatus and sound reproducing system
WO2013083947A1 (en) * 2011-12-08 2013-06-13 Sontia Logic Ltd Reducing resonance
GB2519675A (en) * 2013-10-24 2015-04-29 Linn Prod Ltd A method for reducing loudspeaker phase distortion
EP2941012A3 (en) * 2014-04-30 2015-11-11 Panasonic Intellectual Property Management Co., Ltd. Speaker system
EP2947896A4 (en) * 2013-11-19 2015-12-09 Goertek Inc Miniature loudspeaker module and method for enhancing frequency response thereof and electronic equipment
TWI562648B (en) * 2014-10-29 2016-12-11 Sunplus Technology Co Ltd Sound generating device
EP2899995B1 (en) * 2013-11-19 2019-10-30 Goertek Inc. Miniature loudspeaker module, method for enhancing frequency response thereof, and electronic device

Families Citing this family (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9084058B2 (en) 2011-12-29 2015-07-14 Sonos, Inc. Sound field calibration using listener localization
US9219460B2 (en) 2014-03-17 2015-12-22 Sonos, Inc. Audio settings based on environment
US9106192B2 (en) 2012-06-28 2015-08-11 Sonos, Inc. System and method for device playback calibration
US9264839B2 (en) 2014-03-17 2016-02-16 Sonos, Inc. Playback device configuration based on proximity detection
US9952825B2 (en) 2014-09-09 2018-04-24 Sonos, Inc. Audio processing algorithms
WO2016040324A1 (en) * 2014-09-09 2016-03-17 Sonos, Inc. Audio processing algorithms and databases
WO2017049169A1 (en) 2015-09-17 2017-03-23 Sonos, Inc. Facilitating calibration of an audio playback device
US9693165B2 (en) 2015-09-17 2017-06-27 Sonos, Inc. Validation of audio calibration using multi-dimensional motion check
US9743207B1 (en) 2016-01-18 2017-08-22 Sonos, Inc. Calibration using multiple recording devices
US11106423B2 (en) 2016-01-25 2021-08-31 Sonos, Inc. Evaluating calibration of a playback device
US10003899B2 (en) 2016-01-25 2018-06-19 Sonos, Inc. Calibration with particular locations
US9860662B2 (en) 2016-04-01 2018-01-02 Sonos, Inc. Updating playback device configuration information based on calibration data
US9864574B2 (en) 2016-04-01 2018-01-09 Sonos, Inc. Playback device calibration based on representation spectral characteristics
US9763018B1 (en) 2016-04-12 2017-09-12 Sonos, Inc. Calibration of audio playback devices
US9794710B1 (en) 2016-07-15 2017-10-17 Sonos, Inc. Spatial audio correction
US10372406B2 (en) 2016-07-22 2019-08-06 Sonos, Inc. Calibration interface
US10459684B2 (en) 2016-08-05 2019-10-29 Sonos, Inc. Calibration of a playback device based on an estimated frequency response
CN108462921B (en) * 2017-02-20 2020-06-02 北京东方广视科技股份有限公司 Loudspeaker sound field equalizing equipment
KR20200101968A (en) * 2018-01-04 2020-08-28 트라이젠스 세미컨덕터 가부시키가이샤 Speaker drive unit, speaker unit and program
CN108269578B (en) * 2018-02-05 2019-10-18 百度在线网络技术(北京)有限公司 Method and apparatus for handling information
CN110765675B (en) * 2018-07-24 2022-10-04 上汽通用五菱汽车股份有限公司 Noise prediction method for automobile exhaust system
US11206484B2 (en) 2018-08-28 2021-12-21 Sonos, Inc. Passive speaker authentication
US10299061B1 (en) 2018-08-28 2019-05-21 Sonos, Inc. Playback device calibration
CN111970607B (en) * 2019-05-20 2022-07-05 宏碁股份有限公司 Loudspeaker adjusting method and electronic device using same
US10734965B1 (en) 2019-08-12 2020-08-04 Sonos, Inc. Audio calibration of a portable playback device
CN110381415B (en) * 2019-08-27 2021-06-15 联想(北京)有限公司 Loudspeaker, information processing device and method
CN110913307A (en) * 2019-11-28 2020-03-24 歌尔科技有限公司 Intelligent control system and intelligent sound box
CN111131961A (en) * 2019-12-31 2020-05-08 歌尔股份有限公司 Sound box and sound box resonance improvement method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0122663A2 (en) * 1983-04-08 1984-10-24 Tommyca Freadman Method and system for improving speaker performance
US5168251A (en) * 1991-05-29 1992-12-01 Eagle Comtronics, Inc. Quality factor improvement for filter application
US5533120A (en) * 1994-02-01 1996-07-02 Tandy Corporation Acoustic feedback cancellation for equalized amplifying systems
GB2310104A (en) * 1996-02-12 1997-08-13 Yang Yi Fu Loud speaker enclosure and tunable audio reproduction apparatus

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1112317A (en) * 1994-03-07 1995-11-22 王幼华 Self-adaptive noise filter
JPH08237800A (en) * 1995-02-27 1996-09-13 Matsushita Electric Ind Co Ltd Low tone intensifying circuit

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0122663A2 (en) * 1983-04-08 1984-10-24 Tommyca Freadman Method and system for improving speaker performance
US5168251A (en) * 1991-05-29 1992-12-01 Eagle Comtronics, Inc. Quality factor improvement for filter application
US5533120A (en) * 1994-02-01 1996-07-02 Tandy Corporation Acoustic feedback cancellation for equalized amplifying systems
GB2310104A (en) * 1996-02-12 1997-08-13 Yang Yi Fu Loud speaker enclosure and tunable audio reproduction apparatus

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7497003B2 (en) 2002-03-29 2009-03-03 Panasonic Corporation Apparatus and method for supporting speaker design, and program therefor
US8094827B2 (en) 2004-07-20 2012-01-10 Pioneer Corporation Sound reproducing apparatus and sound reproducing system
GB2431527B (en) * 2005-10-20 2011-05-18 Nicholas Palmes Bray Electrified gate
GB2431527A (en) * 2005-10-20 2007-04-25 Nicholas Palmes Bray Electrified gate
US9414156B2 (en) 2011-12-08 2016-08-09 Sontia Logic Limited Reducing resonance
WO2013083947A1 (en) * 2011-12-08 2013-06-13 Sontia Logic Ltd Reducing resonance
GB2519675A (en) * 2013-10-24 2015-04-29 Linn Prod Ltd A method for reducing loudspeaker phase distortion
GB2519675B (en) * 2013-10-24 2016-07-13 Linn Prod Ltd A method for reducing loudspeaker phase distortion
EP2947896A4 (en) * 2013-11-19 2015-12-09 Goertek Inc Miniature loudspeaker module and method for enhancing frequency response thereof and electronic equipment
EP2899995B1 (en) * 2013-11-19 2019-10-30 Goertek Inc. Miniature loudspeaker module, method for enhancing frequency response thereof, and electronic device
EP2941012A3 (en) * 2014-04-30 2015-11-11 Panasonic Intellectual Property Management Co., Ltd. Speaker system
US9414151B2 (en) 2014-04-30 2016-08-09 Panasonic Intellectual Property Management Co., Ltd. Speaker system
TWI562648B (en) * 2014-10-29 2016-12-11 Sunplus Technology Co Ltd Sound generating device

Also Published As

Publication number Publication date
CN100382657C (en) 2008-04-16
MY131348A (en) 2007-08-30
AU6900900A (en) 2001-03-05
CN101883304B (en) 2013-12-25
CN1369188A (en) 2002-09-11
TW479437B (en) 2002-03-11
JP2003506984A (en) 2003-02-18
WO2001011918A3 (en) 2001-11-15
CN101883304A (en) 2010-11-10

Similar Documents

Publication Publication Date Title
WO2001011918A2 (en) Compensation system and method for sound reproduction
US7184556B1 (en) Compensation system and method for sound reproduction
US10291195B2 (en) System and method for digital signal processing
CN103460716B (en) For the method and apparatus of Audio Signal Processing
US10158337B2 (en) System and method for digital signal processing
US6766025B1 (en) Intelligent speaker training using microphone feedback and pre-loaded templates
US20080091416A1 (en) Method, medium and apparatus enhancing a bass signal using an auditory property
US11202161B2 (en) System, method, and apparatus for generating and digitally processing a head related audio transfer function
CN109600698A (en) The audio reproduction that noise reduces
CN104969570A (en) Phase-unified loudspeakers: parallel crossovers
WO2017127286A1 (en) Audio enhancement for head-mounted speakers
WO2018167538A1 (en) Improvements in or relating to audio systems
SE1550164A1 (en) Loudspeaker enclosure with a sealed acoustic suspension chamber
WO2021126981A1 (en) System, method, and apparatus for generating and digitally processing a head related audio transfer function
CN111966322A (en) Audio signal processing method, device, equipment and storage medium
WO1996031082A3 (en) Audio bass speaker driver circuit
JP2007060367A (en) Acoustic system
CN112118520A (en) Doppler compensation for coaxial and offset speakers
CN110679157B (en) Method and system for dynamically extending speaker capability
US7366312B2 (en) Artificial stereophonic circuit and artificial stereophonic device
US10848118B2 (en) System and method for digital signal processing
US7907737B2 (en) Acoustic apparatus
US6788789B2 (en) Phase conversion surround circuitry
JPS61135298A (en) Sound quality adjusting device for speaker
Genereux Adaptive filters for loudspeakers and rooms

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A2

Designated state(s): AE AG AL AM AT AU AZ BA BB BG BR BY BZ CA CH CN CR CU CZ DE DK DM DZ EE ES FI GB GD GE GH GM HR HU ID IL IN IS JP KE KG KP KR KZ LC LK LR LS LT LU LV MA MD MG MK MN MW MX MZ NO NZ PL PT RO RU SD SE SG SI SK SL TJ TM TR TT TZ UA UG UZ VN YU ZA ZW

AL Designated countries for regional patents

Kind code of ref document: A2

Designated state(s): GH GM KE LS MW MZ SD SL SZ TZ UG ZW AM AZ BY KG KZ MD RU TJ TM AT BE CH CY DE DK ES FI FR GB GR IE IT LU MC NL PT SE BF BJ CF CG CI CM GA GN GW ML MR NE SN TD TG

121 Ep: the epo has been informed by wipo that ep was designated in this application
DFPE Request for preliminary examination filed prior to expiration of 19th month from priority date (pct application filed before 20040101)
AK Designated states

Kind code of ref document: A3

Designated state(s): AE AG AL AM AT AU AZ BA BB BG BR BY BZ CA CH CN CR CU CZ DE DK DM DZ EE ES FI GB GD GE GH GM HR HU ID IL IN IS JP KE KG KP KR KZ LC LK LR LS LT LU LV MA MD MG MK MN MW MX MZ NO NZ PL PT RO RU SD SE SG SI SK SL TJ TM TR TT TZ UA UG UZ VN YU ZA ZW

AL Designated countries for regional patents

Kind code of ref document: A3

Designated state(s): GH GM KE LS MW MZ SD SL SZ TZ UG ZW AM AZ BY KG KZ MD RU TJ TM AT BE CH CY DE DK ES FI FR GB GR IE IT LU MC NL PT SE BF BJ CF CG CI CM GA GN GW ML MR NE SN TD TG

WWE Wipo information: entry into national phase

Ref document number: 008115567

Country of ref document: CN

REG Reference to national code

Ref country code: DE

Ref legal event code: 8642

122 Ep: pct application non-entry in european phase