Loudspeaker polarity detection method and system
The speaker polarity detection system uses cross-correlation calculations to determine speaker polarity, solving the problems of high cost and false detection risk in existing technologies. It achieves fast and accurate single speaker polarity detection, improving production efficiency and product quality stability.
Patent Information
- Application Number
- CN202511360760.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-22
- Publication Date
- 2025-11-18
AI Technical Summary
Existing technologies for detecting speaker polarity suffer from high costs, risks of human error, and the inability to detect the polarity of individual speakers, making it difficult to meet the large-scale quality inspection needs of consumer electronics production lines.
A loudspeaker polarity detection system is adopted. The control module generates an excitation signal with pulse markers to drive the loudspeaker to produce sound. The sound is collected by the sound acquisition module, and cross-correlation calculation is performed to determine the polarity state of the loudspeaker.
It enables rapid and accurate detection of the polarity of a single loudspeaker, reduces testing costs, improves the accuracy and reliability of testing, meets the efficiency requirements of large-scale quality inspection, and enhances market competitiveness.
Smart Images

Figure CN120972884A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of loudspeaker technology, and in particular to a loudspeaker polarity detection method and system. BACKGROUND
[0002] A loudspeaker, commonly known as a loudspeaker, is a very commonly used electro-acoustic transducer that can convert audio current signals into sound signals and is an important device in audio equipment.
[0003] The detection of the polarity of the loudspeaker is mainly to verify whether the polarity connection of the loudspeaker is correct, to ensure that the audio signal transmission direction is consistent with the vibration direction, so as to ensure the stability and safety of the sound quality.
[0004] At present, when detecting the polarity of the loudspeaker, the prior art has the following problems:
[0005] (1) When relying on third-party customized audio analyzers and customized test fixtures, there is a high cost problem, which is not conducive to market competitiveness;
[0006] (2) When testing by manual visual method, there are high-risk production quality hidden dangers such as missed detection and misdiagnosis;
[0007] (3) When using the relative polarity detection technology of the multi-loudspeaker system, since it relies on a microphone array to group and cluster analyze at least two loudspeakers, it can only determine the relative phase relationship between two or more loudspeakers, and cannot detect the polarity of a single loudspeaker. In the automatic test scene of consumer electronics production line, the core requirement is to quickly detect the polarity of a single loudspeaker such as a mobile phone and TWS earphone through a standardized process to adapt to the large-scale quality inspection efficiency of hundreds of pieces per minute.
[0008] Therefore, it is necessary to improve the prior art.
[0009] The above information is given as background information only to assist in understanding the present disclosure, and does not determine or acknowledge whether any of the above content can be used as prior art with respect to the present disclosure. SUMMARY
[0010] The present application provides a loudspeaker polarity detection method and system to quickly and accurately determine the polarity of a single loudspeaker.
[0011] To achieve the above-mentioned purpose, the present application provides the following technical solutions:
[0012] In a first aspect, the present application provides a loudspeaker polarity detection method, which is realized by a loudspeaker polarity detection system, the loudspeaker polarity detection system comprising a control module, a signal conversion module and a sound collection module, and the method comprising:
[0013] S101, the control module generates an effective excitation signal, and adds a pulse mark at a signal end position of the excitation signal;
[0014] S102, the control module sends the excitation signal to the signal conversion module, so as to be converted by the signal conversion module and drive the speaker to be tested to emit sound;
[0015] S103, the control module receives a test signal; the test signal is collected by the sound collection module on the sound emitted by the speaker, and is obtained by conversion of the signal conversion module;
[0016] S104, the control module performs cross-correlation calculation on the excitation signal and the test signal, to obtain a cross-correlation function array;
[0017] S105, the control module extracts a maximum value of an absolute value of each data in the cross-correlation function array, and judges whether the maximum value corresponds to original data greater than 0 in the cross-correlation function array; if yes, S106 is executed, and if no, S107 is executed;
[0018] S106, it is determined that the polarity of the speaker is positive connection;
[0019] S107, it is determined that the polarity of the speaker is reverse connection.
[0020] Further, in the speaker polarity detection method, the S101 comprises:
[0021] S1011, the control module compares a safety rated voltage of the speaker to be tested with a maximum output voltage of the signal conversion module, and takes a smaller one as a voltage threshold;
[0022] S1012, the control module generates an excitation signal; an amplitude of the excitation signal is less than or equal to the voltage threshold;
[0023] S1013, it is detected whether the amplitude of the excitation signal is greater than or equal to a minimum effective driving voltage of the speaker; if yes, S1014 is executed, and if no, S1015 is executed;
[0024] S1014, it is determined that the excitation signal is effective, a pulse mark is added at a signal end position of the excitation signal, and the excitation signal is outputted;
[0025] S1015, it is determined that the excitation signal is invalid, polarity detection is not performed, and an alarm is triggered.
[0026] Further, in the speaker polarity detection method, the S1011 comprises:
[0027] S10111、the control module acquires the safe rated voltage of the speaker to be tested by reading the EEPROM of the speaker;
[0028] Alternatively, the control module acquires the safe rated voltage of the speaker to be tested by impedance detection.
[0029] Further, in the speaker polarity detection method, after the S103 and before the S104, the method further comprises:
[0030] S103.5, the control module aligns the signal length of the excitation signal and the test signal by using end zero padding.
[0031] Further, in the speaker polarity detection method, the S103.5 comprises:
[0032] S103.51, the control module compares the signal length of the excitation signal and the test signal to determine the smaller one;
[0033] S103.52, the control module pads zero values at the end position of the smaller signal to align the signal length of the excitation signal and the test signal.
[0034] Further, in the speaker polarity detection method, the S103.51 comprises:
[0035] S103.511, the control module extracts the time domain data of the excitation signal and the test signal respectively;
[0036] S103.512, the control module compares the signal length of the time domain data of the excitation signal and the time domain data of the test signal to determine the smaller one.
[0037] Further, in the speaker polarity detection method, the S105 comprises:
[0038] S1051, the control module performs absolute value calculation on each data in the cross-correlation function array to generate an absolute value array;
[0039] S1052, the control module searches for the maximum value in the absolute value array;
[0040] S1053, the control module judges whether the original data corresponding to the maximum value in the cross-correlation function array is greater than 0.
[0041] Further, in the speaker polarity detection method, the S1052 comprises:
[0042] S10521, the control module initializes a maximum variable, sets it to the first element of the absolute value array;
[0043] S10522, the control module traverses each element in the absolute value array, starting from the second element;
[0044] S10523, the control module compares each element with the current maximum variable, and if the element is greater than the current maximum variable, updates the maximum variable;
[0045] S10524, the control module repeats S10522 to S10523 until all elements in the absolute value array are traversed to determine the maximum value in the absolute value array.
[0046] Further, in the speaker polarity detection method, in the S101, when the speaker to be tested is a high-frequency speaker, the added pulse mark adopts a narrow pulse with a period T=10μs;
[0047] When the speaker to be tested is a low-frequency speaker, the added pulse mark adopts a wide pulse with a period T=50μs.
[0048] In a second aspect, the present application provides a speaker polarity detection system, which comprises a control module, a signal conversion module and a sound collection module;
[0049] The signal conversion module is used to receive an excitation signal from the control module and convert the excitation signal to drive the speaker to be tested to produce sound; and is used to convert the test signal from the sound collection module;
[0050] The sound collection module is used to collect the sound produced by the speaker to obtain a test signal;
[0051] The control module is used to:
[0052] Generate an effective excitation signal and add a pulse mark at the signal end position of the excitation signal;
[0053] Send the excitation signal to the signal conversion module;
[0054] Receive the test signal;
[0055] Correlate the excitation signal with the test signal to obtain a cross-correlation function array;
[0056] extract the maximum value of the absolute value of each data in the cross-correlation function array, and determine whether the maximum value is greater than 0; if yes, it is determined that the polarity of the loudspeaker is positive connection, and if no, it is determined that the polarity of the loudspeaker is reverse connection.
[0057] Further, in the loudspeaker polarity detection system, the control module is specifically used for:
[0058] Comparing the safe rated voltage of the loudspeaker to be tested with the maximum output voltage of the signal conversion module, and taking the smaller one as the voltage threshold;
[0059] Generating an excitation signal; the amplitude of the excitation signal is less than or equal to the voltage threshold;
[0060] Detecting whether the amplitude of the excitation signal is greater than or equal to the minimum effective driving voltage of the loudspeaker; if yes, it is determined that the excitation signal is effective, a pulse mark is added at the signal end position of the excitation signal, and the excitation signal is output; if no, it is determined that the excitation signal is invalid, no polarity detection is performed, and an alarm is triggered.
[0061] Further, in the loudspeaker polarity detection system, the control module is specifically used for:
[0062] By reading the EEPROM of the loudspeaker to be tested, the safe rated voltage of the loudspeaker is obtained;
[0063] Or, the safe rated voltage of the loudspeaker to be tested is obtained by impedance detection.
[0064] Further, in the loudspeaker polarity detection system, the control module is further used for:
[0065] Before cross-correlation calculation, the end zero padding method is used to align the signal length of the excitation signal and the test signal.
[0066] Further, in the loudspeaker polarity detection system, the control module is specifically used for:
[0067] Comparing the signal length of the excitation signal and the test signal to determine the smaller one;
[0068] Padding zero value at the signal end position of the smaller one to align the signal length of the excitation signal and the test signal.
[0069] Further, in the loudspeaker polarity detection system, the control module is specifically used for:
[0070] Respectively extracting the time domain data of the excitation signal and the test signal;
[0071] The time domain data of the excitation signal is compared with the time domain data of the test signal in signal length to determine the smaller one of the two.
[0072] Further, in the loudspeaker polarity detection system, the control module is specifically used for:
[0073] Absolute value calculation is performed on each data in the cross-correlation function array to generate an absolute value array.
[0074] The maximum value in the absolute value array is searched.
[0075] It is judged whether the original data corresponding to the maximum value in the cross-correlation function array is greater than 0.
[0076] Further, in the loudspeaker polarity detection system, the control module is specifically used for:
[0077] The maximum value variable is initialized and set as the first element of the absolute value array.
[0078] Each element in the absolute value array is traversed, starting from the second element.
[0079] For each element, it is compared with the current maximum value variable, and if the element is greater than the current maximum value variable, the maximum value variable is updated.
[0080] The S10522 to S10523 are repeated until all elements in the absolute value array are traversed to determine the maximum value in the absolute value array.
[0081] Further, in the loudspeaker polarity detection system, when the loudspeaker to be tested is a high-frequency loudspeaker, the added pulse mark adopts a narrow pulse with a period T=10us.
[0082] When the loudspeaker to be tested is a low-frequency loudspeaker, the added pulse mark adopts a wide pulse with a period T=50us.
[0083] Compared with the prior art, the present application has the following beneficial effects:
[0084] The application provides a loudspeaker polarity detection method and system, wherein a control module generates an excitation signal with a pulse mark, a signal conversion module drives a loudspeaker to be tested to emit sound, a sound collection module collects the sound emitted by the loudspeaker to obtain a test signal, and the two signals are subjected to cross-correlation calculation, so that the polarity state of a single loudspeaker can be quickly and accurately judged. Compared with the prior art, the method does not need to rely on an expensive audio analyzer and a customized test fixture, thereby effectively reducing the detection cost; meanwhile, the risk of missed detection and misjudgment in manual visual detection is avoided, and the accuracy and reliability of detection are improved; in addition, the method is suitable for the automatic test scene of a consumer electronics production line, can realize the quick polarity detection of a single loudspeaker, meets the large-scale quality inspection efficiency requirement of hundreds of pieces per minute, significantly improves the production efficiency and product quality stability, and helps to enhance the market competitiveness.
[0085] The present application has other characteristics and advantages that will be apparent from or explained in the accompanying drawings and subsequent detailed description, which are incorporated herein and which together serve to explain certain principles of the present application. BRIEF DESCRIPTION OF DRAWINGS
[0086] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0087] Figure 1 is one of the flowcharts of the loudspeaker polarity detection method provided by the first embodiment of the present application;
[0088] Figure 2 is a schematic diagram of the excitation signal with a pulse mark mentioned in the first embodiment of the present application;
[0089] Figure 3 is a schematic diagram of the loudspeaker in normal connection, in which the phase of the excitation signal is consistent with that of the test signal;
[0090] Figure 4 is a schematic diagram of the loudspeaker in reverse connection, in which the phase of the excitation signal is 180° away from that of the test signal
[0091] Figure 5 is a further refined flowchart of S101 provided by the first embodiment of the present application;
[0092] Figure 6is a flowchart of a second loudspeaker polarity detection method provided by embodiment one of the present application;
[0093] Figure 7 is a further refined flowchart of S103.5 provided by embodiment one of the present application;
[0094] Figure 8 is a further refined flowchart of S103.51 provided by embodiment one of the present application;
[0095] Figure 9 is a further refined flowchart of S105 provided by embodiment one of the present application;
[0096] Figure 10 is a further refined flowchart of S1052 provided by embodiment one of the present application;
[0097] Figure 11 is a structural diagram of a loudspeaker polarity detection system provided by embodiment two of the present application.
[0098] Reference signs:
[0099] The control module 201, the signal conversion module 202, the sound collection module 203, and the loudspeaker 204. DETAILED DESCRIPTION
[0100] To explain the possible application scenarios, technical principles, specific implementable schemes, and the purposes and effects achieved by the present application in detail, the specific embodiments listed below are combined with the accompanying drawings for detailed description. The embodiments described in this paper are only used to more clearly illustrate the technical solutions of the present application, and therefore only serve as examples, and cannot limit the protection scope of the present application.
[0101] In this paper, the term "embodiment" means that the specific features, structures or characteristics described in conjunction with the embodiment can be included in at least one embodiment of the present application. The term "embodiment" appearing at various places in the specification does not necessarily refer to the same embodiment, and does not particularly limit its independence or association with other embodiments. In principle, in the present application, as long as there is no technical contradiction or conflict, the technical features mentioned in each embodiment can be combined in any way to form a corresponding implementable technical solution.
[0102] Unless otherwise defined, the meanings of the technical terms used in this paper are the same as those commonly understood by those skilled in the art to which the present application belongs; the use of related terms in this paper is only for the purpose of describing specific embodiments, and is not intended to limit the present application.
[0103] In the description of the present application, the phrase "and / or" is a description of a logical relationship between objects, which means that there can be three relationships, for example, A and / or B, which means that there are three cases: A exists, B exists, and A and B exist at the same time. In addition, the character " / " herein generally represents that the associated objects before and after are a "or" logical relationship.
[0104] In the present application, the terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual quantity, primary and secondary or order relationship between the entities or operations.
[0105] Without more limitations, in the present application, the "includes", "contains", "has" or other similar expressions used in the sentence are intended to cover non-exclusive inclusion, and these expressions do not exclude the presence of other elements in the process, method or product including the described elements, so that the process, method or product including a series of elements can not only include those limited elements, but also include other elements not explicitly listed, or also include the elements inherent to such process, method or product.
[0106] In the present application, the expressions such as "greater than", "less than", "exceed" and the like are understood as not including the number; the expressions such as "above", "below", "within" and the like are understood as including the number. In addition, in the description of the embodiments of the present application, the meaning of "multiple" is more than two (including two), and similar expressions related to "multiple" are also understood in this way, for example, "multiple groups", "multiple times" and the like, unless otherwise explicitly limited.
[0107] In the description of the embodiments of the present application, the spatial-related expressions used, such as "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "vertical", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like, indicate the orientation or positional relationship based on the orientation or positional relationship shown in the specific embodiments or the drawings, and are only for the convenience of describing the specific embodiments of the present application or for the reader to understand, and do not indicate or imply that the indicated device or component must have a specific position, a specific orientation, or be constructed or operated in a specific orientation, and therefore cannot be understood as a limitation on the embodiments of the present application.
[0108] Unless otherwise clearly indicated or implied to the contrary by context, as used herein the terms "mount", "connected", "connecting", "fixed", "set", and the like, are to be construed in a broad sense, and can encompass fixed or detachable connections, or integrally formed connections. They can be mechanical, electrical, or communicative connections. They can be direct connections, or indirect connections via an intermediate medium. They can be internal connections within two elements, or an interactive relationship between two elements. Those skilled in the art will understand the specific meaning of the above terms in the context of the embodiments of the present application according to the specific circumstances.
[0109] Embodiment One
[0110] Reference is made to Figure 1 A flowchart of a loudspeaker polarity detection method provided by Embodiment One of the present application is shown. The method is suitable for detecting the polarity of a single loudspeaker. The method is performed by a loudspeaker polarity detection system, which can be implemented by software and / or hardware. Specifically, the loudspeaker polarity detection system includes a control module, a signal conversion module, and a sound collection module. The method specifically includes the following steps:
[0111] S101. The control module generates an effective excitation signal, and adds a pulse mark at the signal end position of the excitation signal.
[0112] It should be noted that the control module is the core control part of the entire detection system. It first generates an effective excitation signal for driving the loudspeaker to be tested to produce sound. This excitation signal is the basis for subsequent detection.
[0113] Adding a pulse mark at the signal end position of the excitation signal is a key step. The pulse mark serves as a special identifier, as shown in Figure 2 In subsequent signal processing and analysis, it helps the system to more accurately identify and locate the signal, so as to make polarity judgment.
[0114] In one embodiment of the present embodiment, when the loudspeaker to be tested is a high-frequency loudspeaker (> 5 kHz), the added pulse mark is a narrow pulse with a period T = 10 μs, which is adapted to the fast vibration characteristics (diaphragm response time < 5 μs) of the high-frequency loudspeaker, to ensure that the pulse energy is concentrated and has no distortion;
[0115] When the loudspeaker to be tested is a low-frequency loudspeaker (< 500 Hz), the added pulse mark is a wide pulse with a period T = 50 μs, which provides sufficient driving energy to overcome the inertia of the diaphragm (typical low-frequency loudspeaker startup delay > 20 μs), to ensure that the mark signal is triggered effectively.
[0116] S102, the control module sends the excitation signal to the signal conversion module for conversion by the signal conversion module and driving the speaker to be tested to emit sound.
[0117] It should be noted that the role of the signal conversion module is to convert the excitation signal into a signal form suitable for driving the speaker, so that the speaker to be tested can emit sound according to this converted signal, providing a sound source for subsequent sound collection and polarity detection.
[0118] The control module sends the generated excitation signal to the signal conversion module through the communication interface. In this process, it is necessary to ensure the accurate transmission of the signal to avoid signal distortion or interference.
[0119] After receiving the excitation signal, the signal conversion module will convert it according to the characteristics of the speaker. Specifically, the excitation signal is a digital signal, which will be converted into an analog signal by the signal conversion module and amplified to have enough power to drive the speaker to emit sound. The converted signal is sent to the speaker to be tested, making the speaker vibrate and emit sound.
[0120] S103, the control module receives a test signal; the test signal is collected by the sound collection module on the sound emitted by the speaker, and is converted by the signal conversion module.
[0121] It should be noted that the sound collection module is placed in a suitable position to collect the sound emitted by the speaker. The collected sound signal is an analog signal, whose amplitude and frequency will change with the change of the sound.
[0122] After the sound collection module converts the collected analog sound signal into an electrical signal, it is sent to the signal conversion module. The signal conversion module further processes the electrical signal, such as amplification, filtering, etc., to improve the signal quality and signal-to-noise ratio. Then, the processed signal is converted into a format that the control module can receive (i.e. digital signal), and is transmitted to the control module through the communication interface. The control module receives this signal after multiple conversions, i.e. the test signal, which is used for subsequent analysis and judgment.
[0123] S104, the control module calculates the cross-correlation function array by cross-correlating the excitation signal and the test signal.
[0124] It should be noted that cross-correlation calculation is a mathematical method for analyzing the similarity and time relationship between two signals. In this embodiment, cross-correlation calculation is realized based on time domain convolution or fast Fourier transform (FFT) algorithm.
[0125] Specifically, the control module substitutes the excitation signal and the test signal into the cross-correlation calculation formula. The calculation result is an array of cross-correlation functions, where each data point corresponds to a cross-correlation value at a specific time delay. This array reflects the similarity between the excitation signal and the test signal at different time delays.
[0126] S105. The control module extracts the maximum absolute value of each data in the cross-correlation function array and determines whether the original data corresponding to the maximum value in the cross-correlation function array is greater than 0; if yes, then execute S106; if no, then execute S107.
[0127] It is important to note that extracting the maximum value is crucial, as its core purpose is to accurately locate the pulse marker in the test signal. With the speaker operating normally and polarity positive, the excitation signal undergoes a series of conversions and transmissions to drive the speaker to produce sound. The sound acquisition module collects the sound and converts it into a test signal. At this point, the excitation signal and the test signal are in phase, such as... Figure 3 As shown. In this case, the original data corresponding to the maximum value in the cross-correlation function array must be positive, because positive original data reflects the consistency of the two signals in phase.
[0128] However, the situation is quite different when the speaker polarity is reversed. Due to the reversed polarity, the phase of the test signal relative to the excitation signal will be reversed by 180°, such as... Figure 4 As shown. This phase reversal causes the waveforms of the two signals to change completely oppositely on the time axis; the original peaks become troughs, and the troughs become peaks. Correspondingly, the original data corresponding to the maximum value in the cross-correlation function array becomes negative. The negative original data clearly indicates the opposite phase relationship and low correlation between the two signals.
[0129] Based on the above principle, after finding the maximum value in the cross-correlation function array, the control module needs to further judge the original data corresponding to the maximum value, that is, to judge whether it is greater than 0. Then, based on the judgment result, the control module decides to execute the subsequent steps S106 or S107.
[0130] S106. The control module determines that the polarity of the speaker is positive.
[0131] It should be noted that when the original data corresponding to the maximum value in the cross-correlation function array is greater than 0, it indicates that the phase relationship between the excitation signal and the test signal is positive. This means that the speaker is connected to the circuit with the correct polarity, and the control module will determine that the speaker polarity is positive, and can record this result or provide feedback.
[0132] S107, the control module determines that the polarity of the loudspeaker is reverse connection.
[0133] It should be noted that when it is judged that the maximum value in the cross-correlation function array corresponds to the original data less than or equal to 0, it means that the phase relationship between the excitation signal and the test signal meets the reverse connection condition. This indicates that the positive and negative poles of the loudspeaker are connected incorrectly with the circuit, and the control module will determine that the polarity of the loudspeaker is reverse connection, and can trigger an alarm or take other measures to correct the connection error in time.
[0134] Please refer to Figure 5 In an embodiment of the present embodiment, in order to perfect the technical details, the S101 is further limited, specifically, the S101 can be further refined to include the following steps:
[0135] S1011, the control module compares the safety rated voltage of the loudspeaker to be tested with the maximum output voltage of the signal conversion module, and takes the smaller one as the voltage threshold.
[0136] It should be noted that the core purpose of this step is to ensure that in the subsequent process of generating the excitation signal and driving the loudspeaker, neither the loudspeaker nor the signal conversion module will be damaged. The safety rated voltage of the loudspeaker is the highest voltage value that it can withstand without being damaged, and the maximum output voltage of the signal conversion module is the maximum voltage that it can stably output. By comparing the two voltage values and selecting the smaller one as the voltage threshold, a safe voltage upper limit can be provided for the subsequent generation of the excitation signal, ensuring the stability and reliability of the entire detection system.
[0137] Specifically, the control module has a voltage comparison function inside, which detects or reads the pre-stored safety rated voltage parameter of the loudspeaker to be tested, and obtains the maximum output voltage information of the signal conversion module. Then, the built-in comparison algorithm is used to compare the two voltage values. For example, if the safety rated voltage of the loudspeaker is 2V and the maximum output voltage of the signal conversion module is 1V, then after comparison, the voltage threshold will be determined as 1V.
[0138] S1012, the control module generates an excitation signal; the amplitude of the excitation signal is less than or equal to the voltage threshold.
[0139] It should be noted that the excitation signal is generated to drive the loudspeaker to make sound for subsequent sound collection and polarity detection. Limiting the amplitude of the excitation signal to be less than or equal to the voltage threshold is to ensure that the voltage of the excitation signal is within a safe range, avoiding damage to the loudspeaker or the signal conversion module due to excessive voltage, while ensuring that the signal conversion module can work normally and accurately convert the excitation signal into a signal suitable for driving the loudspeaker.
[0140] During the generation process, the control module monitors the amplitude of the excitation signal in real time and adjusts signal generation parameters such as gain, amplitude coefficient, etc. to ensure that the amplitude of the excitation signal is always less than or equal to the previously determined voltage threshold. For example, if the voltage threshold is 1V, the amplitude of the excitation signal generated by the control module may be set to 0.8V.
[0141] S1013, the control module detects whether the amplitude of the excitation signal is greater than or equal to the minimum effective driving voltage of the loudspeaker; if yes, S1014 is executed, if not, S1015 is executed.
[0142] It should be noted that the minimum effective driving voltage of the loudspeaker is the lowest voltage requirement for it to produce a detectable sound signal. Detecting whether the amplitude of the excitation signal meets this requirement is to ensure that the excitation signal can effectively drive the loudspeaker to produce sound of sufficient intensity and clarity, thereby ensuring the accuracy and reliability of subsequent sound collection and polarity detection. If the amplitude of the excitation signal is too small, the loudspeaker may not produce sound or the sound produced may be too weak, resulting in the sound collection module being unable to collect effective sound signals, which in turn affects the polarity detection result.
[0143] Specifically, the control module has a voltage detection function inside, which can obtain the amplitude information of the currently generated excitation signal in real time and compare it with the minimum effective driving voltage of the loudspeaker. For example, if the minimum effective driving voltage of the loudspeaker is 0.5V and the amplitude of the current excitation signal is 0.8V, it meets the condition of being greater than or equal to the minimum effective driving voltage, and the control module will execute S1014; if the amplitude of the excitation signal is 0.4V, it does not meet the condition, and the control module will execute S1015.
[0144] S1014, the control module determines the excitation signal to be valid, adds a pulse mark at the signal end position of the excitation signal, and outputs.
[0145] It should be noted that when the amplitude of the excitation signal meets the minimum effective driving voltage requirement of the loudspeaker, it means that the excitation signal can effectively drive the loudspeaker to produce sound, so it is determined to be a valid excitation signal. Adding a pulse mark at the signal end position of the excitation signal provides a clear time reference point for subsequent signal processing and analysis. Through this pulse mark, the relationship between the excitation signal and the test signal can be more accurately identified, thereby improving the accuracy of polarity judgment.
[0146] S1015, the control module determines the excitation signal to be invalid, does not perform polarity detection, and triggers an alarm.
[0147] It should be noted that when the amplitude of the excitation signal does not meet the minimum effective driving voltage requirement of the loudspeaker, it means that the excitation signal cannot effectively drive the loudspeaker to produce sound, and at this time the polarity detection cannot obtain accurate results. Therefore, the excitation signal is determined as an invalid signal, and the subsequent polarity detection process is stopped, and an alarm mechanism is triggered to timely notify the operator or related system to check and handle the problem, so as to avoid invalid detection operation and possible error results.
[0148] In summary, through the above steps, the embodiment can ensure that an effective excitation signal is generated within a safe voltage range, and the accuracy of signal processing is improved by adding pulse markers. This method not only improves the reliability of detection, but also avoids invalid detection operation through the alarm mechanism, ensuring the stability and accuracy of the entire detection system.
[0149] Further, in the embodiment, the S1011 can be further refined to include the following steps:
[0150] S10111, the control module reads the EEPROM of the loudspeaker to be tested to obtain the safe rated voltage of the loudspeaker;
[0151] Or, the control module obtains the safe rated voltage of the loudspeaker to be tested through impedance detection.
[0152] It should be noted that in the former case, the control module needs to establish an electrical connection with the EEPROM (Electrically Erasable Programmable Read-Only Memory) of the loudspeaker, usually through a specific communication interface (such as I2C, SPI, etc.). These interfaces have standard pin definitions and communication protocols, which can ensure the accuracy and reliability of data transmission.
[0153] The control module sends a read instruction to the EEPROM of the loudspeaker according to the requirements of the communication protocol, specifying the data storage address to be read (i.e. the address of the safe rated voltage information). After receiving the instruction, the EEPROM sends the data stored in the corresponding address to the control module. After receiving the data, the control module performs analysis and verification to ensure that the read safe rated voltage information is accurate.
[0154] Exemplarily, assuming the EEPROM of the loudspeaker employs an I²C interface with address 0x50, and the safety voltage rating information is stored at addresses 0x00-0x01. The control module first initializes the I²C interface with a clock frequency of 100 kHz. Then, it sends a start condition, followed by the slave address 0x50 and a write flag (0), and then the address 0x00 to be read. After that, it re-sends a start condition, sends the slave address 0x50 and a read flag (1), and finally reads two bytes of data, which, when combined, is the safety voltage rating of the loudspeaker.
[0155] In the latter case, since the impedance characteristics of the loudspeaker are related to its safety voltage rating, by detecting the impedance values of the loudspeaker at different frequencies and using a pre-established impedance-safety voltage rating model or empirical formula, the safety voltage rating of the loudspeaker can be estimated, thereby providing a basis for subsequent voltage threshold setting.
[0156] Specifically, the control module needs to connect an impedance detection circuit, which typically includes a signal generator, a current detection circuit, and a voltage detection circuit. The signal generator is used to generate an AC signal of a specific frequency and amplitude, which is applied to the loudspeaker; the current detection circuit is used to measure the current through the loudspeaker; and the voltage detection circuit is used to measure the voltage across the loudspeaker.
[0157] The control module controls the signal generator to scan in different frequency ranges, for example from 20 Hz to 20 kHz, to cover the normal operating frequency range of the loudspeaker. At each frequency point, the signal generator outputs an AC signal of a fixed amplitude.
[0158] At each frequency point, the control module simultaneously reads the measurement values of the current detection circuit and the voltage detection circuit, and calculates the impedance value of the loudspeaker at that frequency according to Ohm's law Z = U / I (where Z is impedance, U is voltage, and I is current).
[0159] The control module matches and calculates the series of measured impedance values with the pre-stored impedance-safety voltage rating model or empirical formula. Through these calculations, the control module can estimate the safety voltage rating of the loudspeaker.
[0160] Exemplarily, assuming the pre-established impedance-safety voltage rating empirical formula is V safe =k×Z max , where V safe is the safety voltage rating, k is an empirical coefficient (e.g. k = 0.1), and Z max is the maximum impedance value measured during the frequency scan. After completing the frequency scan and impedance calculation, the control module finds the maximum impedance value Z max= 50Ω, then the estimated safe rated voltage V safe = 0.1 x 50 = 5V.
[0161] In summary, through the above steps, the safe rated voltage of the loudspeaker can be obtained in two ways. These two methods have their own advantages, and the appropriate method can be selected according to the specific application scene and device conditions. By ensuring that the obtained safe rated voltage information is accurate, reliable basis can be provided for subsequent voltage threshold setting and excitation signal generation, thereby improving the stability and reliability of the entire detection system.
[0162] Please refer to Figure 6 In one embodiment of the present embodiment, in Figure 1 Based on the technical solutions provided, after S103 and before S104, the method is further optimized, that is, the method further includes S103.5. The explanations of the same or corresponding terms in the above embodiments are not repeated here.
[0163] S103.5, the control module aligns the signal length of the excitation signal and the test signal by using the end zero padding method.
[0164] It should be noted that in the signal processing and analysis process, the excitation signal and the test signal usually need to have the same length in order to perform subsequent accurate comparison, correlation calculation and other operations. Due to various reasons, the lengths of the excitation signal and the test signal may not be consistent in the actual signal collection and processing process, such as slight differences in the starting time of signal collection, inconsistent sampling rates of collection devices, etc. The end zero padding method can make the lengths of the two signals consistent without changing the original characteristic information of the signals, providing signal data that meets the requirements for subsequent steps, and ensuring the accuracy and reliability of the entire detection process.
[0165] In summary, at this stage after S103 and before S104, the addition of S103.5 step is of great significance. By using the end zero padding method to align the signal lengths of the excitation signal and the test signal, the problem of inconsistent signal lengths caused by various factors is solved. This operation ensures that the subsequent steps can be accurately processed and analyzed based on signals of the same length, such as calculating the correlation between them, judging the polarity of the loudspeaker, etc., thereby improving the accuracy and stability of the entire loudspeaker detection method, and making the detection result more reliable.
[0166] Please refer to Figure 7 In one embodiment of the present embodiment, the S103.5 is further refined, which specifically includes the following steps:
[0167] S103.51, the control module compares the signal length of the excitation signal and the test signal to determine the smaller one.
[0168] It should be noted that the control module reads the sampling point number N 激励 of the excitation signal and the sampling point number N 测试 of the test signal from the data structure storing the excitation signal and the test signal, respectively. For example, the excitation signal is stored in an array containing 1000 sampling points, so N 激励 = 1000; the test signal is stored in an array containing 800 sampling points, so N 测试 = 800.
[0169] The control module compares N 激励 and N 测试 using a comparison algorithm. If N 激励 < N 测试 , the excitation signal is the smaller one; if N 激励 > N 测试 , the test signal is the smaller one; if N 激励 = N 测试 , the signal length is already aligned, and no subsequent zero padding operation is needed, but for the completeness of the process, the equal length can also be recorded.
[0170] S103.52, the control module pads zero values at the end of the smaller signal to align the signal length of the excitation signal and the test signal.
[0171] It should be noted that according to the smaller and larger length obtained in step S103.51, the number of zero values ΔN = N 较大 − N 较小 to be padded is calculated. For example, if the excitation signal length N 激励 = 800 and the test signal length N 测试 = 1000, then ΔN = 1000−800 = 200, i.e. 200 zero values need to be padded at the end of the excitation signal.
[0172] When zero padding, the control module creates a one-dimensional array ZeroArray containing ΔN zeros in the memory. Then the smaller signal array is spliced with the zero value array. Taking the incentive signal as an example, if the incentive signal array is IncentiveArray, the new array NewIncentiveArray after splicing can be realized through array copying and splicing operation. For example, first copy all the elements of IncentiveArray to the first N incentive positions of NewIncentiveArray, and then copy all the elements of ZeroArray to the last ΔN positions of NewIncentiveArray. In this way, the operation of supplementing zero values at the end of the incentive signal is completed, so that its length is consistent with that of the test signal. Similarly, if the test signal is shorter, the same method is used to supplement zero values at the end of the test signal.
[0173] In summary, by further refining S103.5, the problem of inconsistent signal length is solved, laying a foundation for accurate analysis and processing of the incentive signal and the test signal in the future, and ensuring the smooth progress of the entire detection process and the reliability of the results.
[0174] Please refer to Figure 8 In an embodiment of the present embodiment, in Figure 7 Based on the technical solutions provided, the S103.51 is further optimized, i.e., further refined to include S103.511-S103.512. The explanations of the same or corresponding terms in the above embodiments are not repeated here.
[0175] S103.511, the control module extracts the time domain data of the incentive signal and the test signal respectively.
[0176] It should be noted that the time domain data is the form of signal on the time axis, which directly reflects the change of signal with time. In the context of signal processing and comparison, time domain data is the most basic and intuitive source of information. Extracting the time domain data of the incentive signal and the test signal is to accurately compare the lengths of the two signals based on these actual time sequence information in the future. Because only after obtaining the specific sampling point sequence of the signal in the time domain, it can be determined how many sampling points each signal contains, and then the length relationship between them is determined.
[0177] S103.512, the control module compares the time domain data of the incentive signal with the time domain data of the test signal to determine the smaller one.
[0178] It's important to note that comparing the lengths of the excitation and test signals after acquiring their time-domain data is preparation for subsequent signal alignment. By determining the shorter of the two signals, it becomes clear which signal's end needs to be padded with zeros, and how many zeros are needed, thus ensuring the two signals have the same length. This facilitates subsequent signal analysis and processing, such as correlation calculations. Only when the signal lengths are identical can these analytical operations be performed accurately and effectively.
[0179] In summary, the optimization of these two steps makes the signal length comparison more direct and accurate, providing a reliable basis for subsequent operations such as adding zero values at the end of the smaller signal to achieve signal alignment. This further improves the accuracy and stability of the entire signal processing flow and helps to perform more precise detection operations such as speaker polarity determination.
[0180] Please refer to Figure 9 In one embodiment of this example, in Figure 1 Based on the provided technical solution, S105 has been further optimized, specifically refined to include S1051-S1053. Explanations of terms identical or corresponding to those in the above embodiments will not be repeated here.
[0181] S1051, The control module performs absolute value calculation on each data in the cross-correlation function array to generate an absolute value array.
[0182] It should be noted that the cross-correlation function measures the similarity between two signals at different time offsets, and its value can be positive or negative. However, in scenarios such as determining speaker polarity, the strength of signal similarity is more important than whether the similarity is positive or negative. By calculating the absolute value of each data point in the cross-correlation function array, all values can be converted to non-negative numbers to determine the location of the pulse marker in the test signal.
[0183] S1052, The control module searches for the maximum value in the absolute value array.
[0184] It should be noted that the maximum value in the absolute value array corresponds to the position of the pulse marker in the test signal. Finding this maximum value in loudspeaker polarity determination allows for a more accurate identification of the relationship between the excitation signal and the test signal, thereby determining the loudspeaker's polarity.
[0185] S1053, The control module determines whether the original data corresponding to the maximum value in the cross-correlation function array is greater than 0.
[0186] It should be noted that the sign of the original data corresponding to the maximum value in the cross-correlation function array determines the polarity of the loudspeaker. If the original data is greater than 0, it indicates that the phase relationship between the excitation signal and the test signal at that moment indicates that the loudspeaker is positive; if the original data is less than 0, it indicates that the loudspeaker is negative. By using this judgment, the polarity of the loudspeaker can be accurately determined, thus completing the detection task.
[0187] In summary, the three steps described above work together to improve the accuracy and reliability of speaker polarity determination, making the entire testing process more scientific and rigorous.
[0188] Please refer to Figure 10 In one embodiment of this example, step S1052 can be further refined to include the following steps:
[0189] S10521. The control module initializes the maximum value variable and sets it as the first element of the absolute value array.
[0190] It's important to note that initializing the maximum value variable is the starting step in the process of searching for the maximum value in the absolute value array. Initializing the maximum value variable to the first element of the absolute value array provides an initial reference point for subsequent comparisons with other elements. This step ensures that the search process has a clear starting point, allowing subsequent comparison operations to proceed in an orderly manner.
[0191] S10522, The control module traverses each element in the absolute value array, starting from the second element.
[0192] It's important to note that iterating through the array involves visiting each element sequentially to compare it with the current maximum value variable. Iterating from the second element onwards is necessary because the first element has already been used as the initial maximum value variable, eliminating the need for comparison with itself. By iterating through the entire array, it ensures that no element that could potentially be the maximum value is overlooked.
[0193] S10523. For each element, the control module compares it with the current maximum value variable. If the element is greater than the current maximum value variable, the maximum value variable is updated.
[0194] It's important to note that the comparison operation is the core step in searching for the maximum value. By comparing the currently accessed array element with the current maximum value variable, we can determine if that element might be the new maximum value. If the element is greater than the current maximum value variable, it means a larger value has been found, and the maximum value variable needs to be updated to ensure that it always stores the maximum value among the currently accessed elements.
[0195] S10524. The control module repeats S10522 to S10523 until all elements in the absolute value array have been traversed to determine the maximum value in the absolute value array.
[0196] It's important to note that repeatedly performing the traversal and comparison operations ensures that every element in the array is visited and compared with the current maximum value variable. Only after traversing the entire array can the true maximum value be determined, as it can appear at any position within the array. Automatically repeating these steps using a loop structure improves the efficiency and accuracy of the search process.
[0197] In summary, this refined process makes the maximum value search process clearer, easier to understand and implement, while also ensuring the accuracy of the search results.
[0198] Although this application frequently uses terms such as control module, signal conversion module, and sound acquisition module, the possibility of using other terms is not excluded. These terms are used merely for the convenience of describing and explaining the essence of the invention; interpreting them as any additional limitation would contradict the spirit of the invention.
[0199] This invention generates an excitation signal with pulse markers via a control module, which drives the speaker under test to emit sound via a signal conversion module. The sound emitted by the speaker is then acquired by a sound acquisition module to obtain a test signal. The two signals are then cross-correlated to determine the polarity of a single speaker quickly and accurately. Compared to existing technologies, this method eliminates the need for expensive audio analyzers and customized test fixtures, effectively reducing testing costs. Simultaneously, it avoids the risks of missed or false detections associated with manual visual inspection, improving the accuracy and reliability of the test. Furthermore, this method is suitable for automated testing scenarios in consumer electronics production lines, enabling rapid polarity detection of a single speaker and meeting the efficiency requirements of large-scale quality inspection at the level of hundreds of pieces per minute. This significantly improves production efficiency and product quality stability, contributing to enhanced market competitiveness.
[0200] Example 2
[0201] Please refer to Figure 11 Embodiment 2 of the present invention provides a loudspeaker polarity detection system, the system including a control module 201, a signal conversion module 202 and a sound acquisition module 203;
[0202] The signal conversion module 202 is used to receive the excitation signal from the control module 201 and convert the excitation signal to drive the speaker 204 under test to emit sound; and to convert the test signal from the sound acquisition module 203; the signal conversion module 202 may be, for example, a sound card;
[0203] The sound acquisition module 203 is used to acquire the sound emitted by the speaker 204 to obtain a test signal; the sound acquisition module 203 may be a microphone, preferably an omnidirectional microphone;
[0204] The control module 201 is used for:
[0205] Generate a valid excitation signal, and add a pulse marker at the signal end position of the excitation signal;
[0206] The excitation signal is sent to the signal conversion module 202;
[0207] Receive the test signal;
[0208] The excitation signal and the test signal are cross-correlated to obtain a cross-correlation function array.
[0209] Extract the maximum absolute value of each data point in the cross-correlation function array and determine if the maximum value is greater than 0; if yes, determine that the polarity of the speaker 204 is positive; otherwise, determine that the polarity of the speaker 204 is reversed. The control module 201 may be, for example, an industrial computer.
[0210] Optionally, in the loudspeaker polarity detection system, the control module 201 is specifically used for:
[0211] The safe rated voltage of the speaker 204 to be tested is compared with the maximum output voltage of the signal conversion module 202, and the smaller of the two is taken as the voltage threshold.
[0212] Generate an excitation signal; the amplitude of the excitation signal is less than or equal to the voltage threshold.
[0213] The system detects whether the amplitude of the excitation signal is greater than or equal to the minimum effective driving voltage of the speaker 204; if so, it is determined to be a valid excitation signal, a pulse marker is added to the signal end position of the excitation signal, and the signal is output; if not, it is determined to be an invalid excitation signal, polarity detection is not performed, and an alarm is triggered.
[0214] Optionally, in the loudspeaker polarity detection system, the control module 201 is specifically used for:
[0215] The safe rated voltage of the speaker 204 is obtained by reading the EEPROM of the speaker 204 to be tested;
[0216] Alternatively, the safe rated voltage of the speaker 204 under test can be obtained through impedance detection.
[0217] Optionally, in the loudspeaker polarity detection system, the control module 201 is further configured to:
[0218] Before performing cross-correlation calculations, the excitation signal and the test signal are aligned by padding with zeros at the ends.
[0219] Optionally, in the loudspeaker polarity detection system, the control module 201 is specifically used for:
[0220] The signal lengths of the excitation signal and the test signal are compared to determine the smaller of the two.
[0221] Zero values are added at the end of the smaller signal to align the signal lengths of the excitation signal and the test signal.
[0222] Optionally, in the loudspeaker polarity detection system, the control module 201 is specifically used for:
[0223] Extract the time-domain data of the excitation signal and the test signal respectively;
[0224] The time-domain data of the excitation signal and the time-domain data of the test signal are compared in terms of signal length to determine the smaller of the two.
[0225] Optionally, in the loudspeaker polarity detection system, the control module 201 is specifically used for:
[0226] The absolute values of each data point in the cross-correlation function array are calculated to generate an absolute value array;
[0227] Search for the maximum value in the absolute value array;
[0228] Determine whether the original data corresponding to the maximum value in the cross-correlation function array is greater than 0.
[0229] Optionally, in the loudspeaker polarity detection system, the control module 201 is specifically used for:
[0230] Initialize the maximum value variable by setting it to the first element of the absolute value array;
[0231] Iterate through each element in the array of absolute values, starting from the second element;
[0232] For each element, compare it with the current maximum value variable. If the element is greater than the current maximum value variable, update the maximum value variable.
[0233] Repeat steps S10522 to S10523 until all elements in the absolute value array have been traversed to determine the maximum value in the absolute value array.
[0234] Optionally, in the loudspeaker polarity detection system, when the loudspeaker 204 under test is a high-frequency loudspeaker, the added pulse marker adopts a narrow pulse with a period of T=10μs;
[0235] When the speaker 204 under test is a low-frequency speaker, the added pulse marker uses a wide pulse with a period of T=50μs.
[0236] The above system can execute the methods provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the methods.
[0237] Finally, it should be noted that although the above embodiments have been described in the text and drawings of this application, this should not limit the scope of patent protection of this application. Any technical solutions that are based on the essential concept of this application and utilize the content described in the text and drawings of this application, resulting in equivalent structural or procedural substitutions or modifications, as well as the direct or indirect application of the technical solutions of the above embodiments to other related technical fields, are all included within the scope of patent protection of this application.
Claims
1. A method for detecting the polarity of a loudspeaker, characterized in that, The method is implemented using a loudspeaker polarity detection system, which includes a control module, a signal conversion module, and a sound acquisition module. The method includes: The control module generates a valid excitation signal and adds a pulse marker at the end of the excitation signal. The control module sends the excitation signal to the signal conversion module, which then converts the signal and drives the speaker under test to produce sound. The control module receives a test signal; the test signal is obtained by the sound acquisition module acquiring the sound emitted by the speaker and by the signal conversion module converting it. The control module performs cross-correlation calculations on the excitation signal and the test signal to obtain a cross-correlation function array; The control module extracts the maximum absolute value of each data in the cross-correlation function array and determines whether the original data corresponding to the maximum value in the cross-correlation function array is greater than 0; if yes, the polarity of the speaker is determined to be positive; if no, the polarity of the speaker is determined to be reversed.
2. The loudspeaker polarity detection method according to claim 1, characterized in that, The step of the control module generating a valid excitation signal and adding a pulse marker at the end of the excitation signal includes: The control module compares the safe rated voltage of the speaker to be tested with the maximum output voltage of the signal conversion module, and uses the smaller of the two as the voltage threshold. The control module generates an excitation signal; the amplitude of the excitation signal is less than or equal to the voltage threshold. The control module detects whether the amplitude of the excitation signal is greater than or equal to the minimum effective driving voltage of the speaker; if so, it determines that the excitation signal is valid, adds a pulse marker at the signal end of the excitation signal, and outputs it; if not, it determines that the excitation signal is invalid, does not perform polarity detection, and triggers an alarm.
3. The loudspeaker polarity detection method according to claim 2, characterized in that, The step of the control module comparing the safe rated voltage of the speaker to be tested with the maximum output voltage of the signal conversion module and using the smaller of the two as the voltage threshold includes: The control module obtains the safe rated voltage of the speaker by reading the EEPROM of the speaker under test; Alternatively, the control module may obtain the safe rated voltage of the speaker under test through impedance detection.
4. The loudspeaker polarity detection method according to claim 1, characterized in that, After the step of the control module receiving the test signal, and before the step of the control module performing cross-correlation calculation on the excitation signal and the test signal to obtain a cross-correlation function array, the method further includes: The control module uses zero-padding at the ends to align the signal lengths of the excitation signal and the test signal.
5. The loudspeaker polarity detection method according to claim 4, characterized in that, The control module uses zero-padding at the ends to align the signal lengths of the excitation signal and the test signal, including the following steps: The control module compares the signal lengths of the excitation signal and the test signal to determine the smaller of the two. The control module adds a zero value at the end of the smaller signal to align the signal lengths of the excitation signal and the test signal.
6. The loudspeaker polarity detection method according to claim 5, characterized in that, The step of the control module comparing the signal lengths of the excitation signal and the test signal to determine the smaller of the two includes: The control module extracts the time-domain data of the excitation signal and the test signal, respectively; The control module compares the time-domain data of the excitation signal with the time-domain data of the test signal to determine the smaller of the two.
7. The loudspeaker polarity detection method according to claim 1, characterized in that, The step of the control module extracting the maximum absolute value of each data in the cross-correlation function array and determining whether the original data corresponding to the maximum value in the cross-correlation function array is greater than 0 includes: The control module performs absolute value calculations on each data point in the cross-correlation function array to generate an absolute value array; The control module searches for the maximum value in the absolute value array; The control module determines whether the original data corresponding to the maximum value in the cross-correlation function array is greater than 0.
8. The loudspeaker polarity detection method according to claim 7, characterized in that, The step of the control module searching for the maximum value in the absolute value array includes: The control module initializes the maximum value variable by setting it as the first element of the absolute value array; The control module iterates through each element in the absolute value array, starting from the second element; For each element, the control module compares it with the current maximum value variable. If the element is greater than the current maximum value variable, the maximum value variable is updated. The control module iterates through all elements in the absolute value array to determine the maximum value in the absolute value array.
9. The loudspeaker polarity detection method according to claim 1, characterized in that, In the step of generating an effective excitation signal in the control module and adding a pulse marker at the signal end of the excitation signal, when the loudspeaker under test is a high-frequency loudspeaker, the added pulse marker adopts a narrow pulse with a period of T=10μs; When the loudspeaker under test is a low-frequency loudspeaker, the added pulse marker uses a wide pulse with a period of T=50μs.
10. A loudspeaker polarity detection system, characterized in that, The system includes a control module, a signal conversion module, and a sound acquisition module; The signal conversion module is used to receive the excitation signal from the control module and convert the excitation signal to drive the speaker under test to produce sound. And, for converting the test signal from the sound acquisition module; The sound acquisition module is used to acquire the sound emitted by the speaker to obtain a test signal; The control module is used for: Generate a valid excitation signal, and add a pulse marker at the signal end position of the excitation signal; The excitation signal is sent to the signal conversion module; Receive the test signal; The excitation signal and the test signal are cross-correlated to obtain a cross-correlation function array. Extract the maximum absolute value of each data in the cross-correlation function array and determine whether the maximum value is greater than 0; if yes, determine that the polarity of the speaker is positive; if no, determine that the polarity of the speaker is reversed.