This application is based on and claims priority under 35 USC 119 from Japanese Patent Application No. 2022-092931 filed on Jun. 8, 2022, the contents of which are incorporated herein by reference.
The present disclosure relates to an electronic device, a method, and a storage medium.
An electronic musical instrument, which is an example of an electronic device, is common (see, for example, Japanese Patent Application Laid-Open Publication No. 2004-264501). This type of electronic musical instrument protects a speaker by, for example, clipping an input voltage to a speaker using a clip function of a power amplifier.
For example, assume a case of generating an attack sound whose level is high instantaneously. In this case, peaks of the attack sound higher than a certain level may be clipped, and the attack sound may be distorted. It is preferable to protect the speaker while avoiding occurrence of such distortion of the sound.
An aspect of an electronic device relating to the present disclosure includes: an amplifier configured to amplify an input signal and output an output signal obtained by shaping the amplified input signal; and at least one processor. The at least one processor is configured to: obtain a value indicating power supplied to the amplifier, control the amplifier in a first pattern such that a clip value for the output signal decreases, when detecting that the value is larger than a reference potential and that the value becomes larger than a first threshold larger than a second threshold from a state of being smaller than the second threshold; and control the amplifier in a second pattern such that the clip value for the output signal increases, when detecting that the value is larger than the reference potential and that the value becomes smaller than the second threshold from a state of being larger than the first threshold.
Exemplary embodiment of the present disclosure will be described in detail based on the following figures, wherein:
An electronic device, and a method and a storage medium storing a program executed by the electronic device, which is an example of a computer, according to an embodiment of the present disclosure will be described in detail with reference to the drawings.
The electronic musical instrument 1 operates by power supplied from an AC adapter 2. As schematically illustrated in
The current sense amplifier 10 is installed on a power supply path from the AC adapter 2 to the class-D amplifier 40, and measures a voltage drop at a shunt resistor as a value indicating a current consumption in the class-D amplifier 40.
The peak hold circuit 20 detects a peak value of the value measured by the current sense amplifier 10. Specifically, the peak hold circuit 20 holds the peak value of the voltage drop indicating the current consumption in the class-D amplifier 40, and outputs the peak value to an ADIN terminal of the sound source LSI 30.
The sound source LSI 30 is an example of at least one processor, and includes, for example, a single processor or multiple processors. In a case of a configuration including multiple processors, the sound source LSI 30 may be packaged as a single device, or may include a plurality of devices physically separated inside the electronic musical instrument 1.
The sound source LSI 30 obtains a value indicating the current consumption in the class-D amplifier 40 from the peak value input to the ADIN terminal. The value indicating the current consumption is an example of a value indicating the power supplied to the amplifying unit. For the sake of convenience, the value indicating the current consumption in the class-D amplifier 40 will be referred to as a “current consumption value CCV”.
The class-D amplifier 40 is an example of an amplifying unit for amplifying an input signal (an audio signal in the present embodiment).
The current sense amplifier 10, the peak hold circuit 20, and the sound source LSI 30 operate as an acquisition unit for obtaining the current consumption value CCV.
The sound source LSI 30 shapes the waveform of the output signal output from the class-D amplifier 40 by controlling a waveform shaping unit depending on the current consumption value CCV. In the present embodiment, the “waveform shaping unit” shapes the waveform of the output signal output from the amplifying unit, and specifically is a clip circuit 42 included in the class-D amplifier 40. The clip circuit 42 clips an audio signal output from the class-D amplifier 40 (an example of the output signal) to protect the speaker SP.
When the sound source LSI 30 obtains a current consumption value CCV larger than a first threshold, the sound source LSI 30 changes the clip value by the clip circuit 42 in a first pattern. More specifically, the first pattern is a pattern in which a clip value for audio signal is gradually decreased with the passage of time. Here, the clip value indicates a certain potential for clipping an audio signal. That is, in the first pattern, the potential for clipping an audio signal is gradually decreased with the passage of time. That is, the clip value decreases (the potential for clipping becomes lower) with the passage of time, thereby decreasing the amplitude of the audio signal clipped by the clip circuit 42. In the first pattern, the potential for clipping becomes substantially constant since a certain time point.
When the sound source LSI 30 obtains a current consumption value CCV smaller than a second threshold that is lower than the first threshold, the sound source LSI 30 changes the clip value by the clip circuit 42 in a second pattern. More specifically, the second pattern is a pattern in which a clip value for audio signal is gradually increased with the passage of time. In the second pattern, the potential for clipping becomes substantially constant since a certain time point.
An internal memory 32 of the sound source LSI 30 stores table T1 for changing the clip value in the first pattern with the passage of time, and stores table T2 for changing the clip value in the second pattern with the passage of time.
When the current consumption value CCV is larger than the first threshold, the sound source LSI 30 decreases the clip value for clipping the audio signal with the passage of time according to table T1. When the current consumption value CCV is smaller than the second threshold, the sound source LSI 30 increases the clip value for clipping the audio signal with the passage of time in accordance with table T2. In this manner, the sound source LSI 30 dynamically changes the clip value for the audio signal output from the class-D amplifier 40 depending on the current consumption value CCV.
In
In
For example, a high-level speaker output waveform W1 being continuously output from the speaker SP may result in permanent destruction of the speaker SP. The high-level speaker output waveform W1 is a waveform having a large absolute value when taking a reference value 0 V (reference potential) as 0, and is, for example, a waveform larger than a clip-on threshold Th1 to be described later.
In
Therefore, in the present embodiment, the clip value is dynamically changed to protect the speaker SP while preventing the sound from being distorted due to an output signal of a high level being clipped. The dynamic change of the clip value will be specifically described with reference to
The clip-on thresholds Th1 (+) and Th1 (−) are examples of the first threshold. The clip-on threshold Th1 (+) and the clip-on threshold Th1 (−) have the same absolute value and different signs. Hereinafter, the clip-on threshold Th1 (+) and the clip-on threshold Th1 (−) are collectively referred to as the “clip-on threshold Th1”. For example, the “waveform larger the clip-on threshold Th1” means a waveform larger than the absolute value of the clip-on threshold Th1 (+) and the clip-on threshold Th1 (−). For example, a “waveform smaller than the clip-on threshold Th1” means a waveform smaller than the absolute value of the clip-on threshold Th1 (+) and the clip-on threshold Th1 (−).
Clip-off thresholds Th2 (+) and Th2 (−) are examples of the second threshold. The clip-off threshold Th2 (+) and the clip-off threshold Th2 (−) have the same absolute value and different signs. Hereinafter, the clip-off threshold Th2 (+) and the clip-off threshold Th2 (−) are collectively referred to as a “clip-off threshold Th2”. For example, a “waveform larger the clip-off threshold Th2” means a waveform larger than the absolute value of the clip-off threshold Th2 (+) and Th2 (−). For example, a “waveform smaller the clip-off threshold Th2” means a waveform smaller than the absolute value of the clip-off threshold Th2 (+) and Th2 (−).
The clip-on threshold Th1 and the clip-off threshold Th2 are stored in, for example, the internal memory 32. The current consumption value CCV is a value converted into voltage for the convenience of measuring a voltage value as a current value by the current sense amplifier 10. Correspondingly, the clip-on threshold Th1 and the clip-off threshold Th2 are also values converted into voltage.
The clip-on threshold Th1 and the clip-off threshold Th2 are set based on, for example, at least one of the rated noise voltage, the maximum input voltage, and the instantaneous maximum input voltage of the speaker SP which is an example of a predetermined circuit unit. As an example, the clip-on threshold Th1 is set to a value larger than the rated noise voltage and smaller than the maximum input voltage, and the clip-off threshold Th2 is set to a value smaller than the rated noise voltage. The rated noise voltage, the maximum input voltage, and the instantaneous maximum input voltage are defined by JIS C 5532:2014.
The protective curve (thin line) is a curve indicating the correlation between the current value allowed according to the specification of the speaker SP and the time, and is estimated based on the rated noise voltage, the maximum input voltage, and the instantaneous maximum input voltage of the speaker SP by the inventors. The protective curve (thick line) is a curve set by the inventors in consideration of the safety factor for the protective curve (thin line).
In the present embodiment, the clip-on threshold Th1 and the clip-off threshold Th2 are set based on the protective curve (thick line) set in consideration of the safety factor for the protective curve (thin line) indicating the limit value according to the specification of the speaker SP.
That is, in the present embodiment, the clip-on threshold Th1 and the clip-off threshold Th2 are set based on the rated noise voltage, the maximum input voltage, and the instantaneous maximum input voltage of the speaker SP.
In
In
The sound source LSI 30 calculates the envelope of the speaker output waveform W1, and performs threshold determination for the calculated envelope by using the clip-on threshold Th1 and the clip-off threshold Th2.
In period A1, the input voltage to the speaker SP gradually decreases since the time point SIG1. Therefore, for example, when a large continuous sound is input, the speaker SP can be prevented from permanent destruction. In addition, since the input voltage to the speaker SP gradually decreases on the time axis, the occurrence of unnatural sound due to a rapid decrease in the input voltage is prevented.
In
As described above, the sound source LSI 30 controls the clip circuit 42 in a second pattern such that the clip value for audio signal increases when detecting that the current consumption value CCV is larger than the reference potential (0 V) and that the current consumption value CCV becomes smaller than the clip-off threshold Th2 from a state of being larger than the clip-on threshold Th1.
In
The speaker SP can instantaneously output a large sound such as an attack sound, as defined by the maximum input voltage and the instantaneous maximum input voltage. On the other hand, the speaker SP cannot continuously output a sound higher than the rated noise voltage. Therefore, in
As illustrated in table T1, the clip value for audio signal gradually decreases instead of decreasing immediately after the attack sound is generated (immediately after the detection). Therefore, the attack sound is output without the peak of the instantaneous attack waveform W3 being clipped. Therefore, it is possible to avoid the occurrence of the distortion of the attack sound due to the clipping of the peak, which improves the sound quality of the attack sound.
As described above, the sound source LSI 30 sets table T1 (in other words, the first pattern and the decrease rate of the clip value) such that at least one of feature signals included in the output signal (for example, the attack waveform W3) is not shaped by the clip circuit 42.
In addition, the sound source LSI 30 controls the clip circuit 42 in a first pattern such that the clip value for audio signal decreases when detecting that the current consumption value CCV is larger than the reference potential (0 V) and that the current consumption value CCV becomes larger than the clip-on threshold Th1 from a state of being smaller than the clip-off threshold Th2.
In
In
In
As described above, according to the present embodiment, for example, an instantaneously high-level audio signal (a signal including an attack sound) is clipped, thereby protecting the speaker SP while avoiding the attack sound from being distorted.
A specific configuration of the electronic musical instrument 1 will be described.
The power supply circuit 50 generates electric power to be supplied to each unit of the electronic musical instrument 1 from electric power supplied from the AC adapter 2 or a battery attached to the electronic musical instrument 1, and supplies the generated electric power to each unit.
The sound source LSI 30, which is an example of at least one processor, reads programs and data stored in the flash ROM 54, and comprehensively controls the electronic musical instrument 1 by using the RAM 52 as a work area.
The RAM 52 temporarily stores data and programs. The RAM 52 stores the programs, data (waveform data and the like) read from the flash ROM 54, and also data necessary for communication.
The flash ROM 54 is a nonvolatile semiconductor memory such as a flash memory, an EPROM (Erasable Programmable ROM), or an EEPROM (Electrically Erasable Programmable ROM).
The switch panel 56 is, for example, an operation panel provided on the housing of the electronic musical instrument 1, and may include a LED (Light Emitting Diode) 56a and a touch device 56b. When each of the plurality of LEDs 56a emits light, various icons for accepting various operations are displayed on the top plate of the electronic musical instrument 1.
The touch device 56b incorporates, for example, a capacitive or optical touch panel. When the user touches an icon displayed on the top board, an operation signal indicating operation details is output to the sound source LSI 30 via the microcomputer 58. By the sound source LSI 30 controlling each unit based on the operation signal, the electronic musical instrument 1 performs an operation in response to the user's operation. As an example, the user can designate a tone (guitar, bass, piano, or the like) by a touch operation on the touch device 56b.
The switch panel 56 is not limited to such a touch panel. The switch panel 56 may include mechanical, capacitive non-contact, or membrane operators, such as switches or buttons.
The keyboard 60 is a keyboard having a plurality of white keys and a plurality of black keys as a plurality of performance operators. The respective keys are associated with different pitches.
The key scanner 62 monitors key pressing and key releasing on the keyboard 60. When detecting, for example, a key-pressing operation by the user, the key scanner 62 outputs key-pressing event information to the sound source LSI 30. The key-pressing event information includes information on the pitch of the key (key number) related to the key-pressing operation. The key number may be referred to as a MIDI key or a note number.
In the present embodiment, a unit for measuring the key-pressing speed of the key (velocity value) is provided separately. The velocity value measured by this unit is also included in the key-pressing event information. For example, the respective keys are provided with a plurality of contact switches. The velocity value is measured by the difference in time during which each contact switch is conducted in response to the keys being pressed. The velocity value may be a value indicating the strength of the key-pressing operation or a value indicating the magnitude (volume) of the musical sound.
The LCD 64 is driven by the LCD controller 66. When the LCD controller 66 drives the LCD 64 in accordance with a control signal from the sound source LSI 30, a screen corresponding to the control signal is displayed on the LCD 64. The LCD 64 may be replaced with a display device such as an organic EL (Electro Luminescence). The LCD 64 may be one of operators incorporating a touch panel.
The operators 68 may include various operators for operating the electronic musical instrument 1, such as knobs (main volume knob, etc.), buttons, and pedals.
The USB interface 70 is, for example, an interface for transmitting and receiving MIDI data (MIDI message) to and from an external MIDI (Musical Instrument Digital Interface) device.
The external input interface 72 is, for example, an audio interface to which an external device such as a microphone is connected. The external output interface 74 is, for example, an audio interface to which an external device, such as an amplifier-embedded speaker or headphones, is connected.
The sound source LSI 30 reads waveform data corresponding to, for example, the tone selected by the user's operation and the key-pressing event information, and generates a musical sound based on the read waveform data. The sound source LSI 30 includes, for example, 128 generator sections, and can simultaneously generate 128 musical sounds at the maximum.
Digital musical sound data (for example, I2S format) generated by the sound source LSI 30 is input to the class-D amplifiers 40a and 40b, converted into an analog signal, amplified, and output to the speakers SPa and SPb, respectively. As a result, a musical sound corresponding to the key-pressing operation is played.
The sound source LSI 30 converts the peak value input from the peak hold circuit 20 to the ADIN terminal T11 from an analog signal to a digital signal at a predetermined sampling rate, and obtains an average value of every n periods (for example, every four times of sampling) as the current consumption value CCV (step S101). The number of samples used for calculating the average value is set in consideration of, for example, prevention of variation in peak value and delay associated with calculation of the average value.
The current consumption value CCV indicates the total current consumption value of the class-D amplifiers 40a and 40b. Therefore, the sound source LSI 30 calculates a current consumption value CCVa in the class-D amplifier 40a and a current consumption value CCVb in the class-D amplifier 40b from the current consumption value CCV (step S102). For example, the sound source LSI 30 calculates the current consumption value CCVa and the current consumption value CCVb from the current consumption value CCV on the basis of the main volume value, the boost, the cut, and the like of the equalizer set for each of the speakers SPa and SPb.
The sound source LSI 30 executes clip control CC (steps S103 to S109) for each of the class-D amplifiers 40a and 40b.
For example, the sound source LSI 30 first executes the clip control CC (steps S103 to S109) for the class-D amplifier 40a.
Specifically, the sound source LSI 30 determines whether the current consumption value CCVa is larger than the clip-on threshold Th1 (step S103). When the current consumption value CCVa is larger than the clip-on threshold Th1 (step S103: YES), the sound source LSI 30 generates the clip control signal CCa in accordance with table T1 (step S104). The clip control signal CCa is a control signal for controlling the clip circuit 42a of the class-D amplifier 40a.
The sound source LSI 30 outputs the clip control signal CCa generated in step S104 and a main volume signal Va to the class-D amplifier 40a in, for example, I2C (Inter-Integrated Circuit) format (step S105). The main volume signal Va is a signal indicating a main volume value set for the speaker SPa.
The class-D amplifier 40a amplifies the audio signal input from the sound source LSI in response to the main volume signal Va, and operates the clip circuit 42a based on the clip control signal CCa to clip the audio signal that is the output signal to the speaker SPa. As a result, the clip value for audio signal decreases with the passage of time (see, for example, period A3 in
When the current consumption value CCVa is equal to or smaller than the clip-on threshold Th1 (step S103: NO), the sound source LSI 30 determines whether the current consumption value CCVa is smaller than the clip-off threshold Th2 (step S106). When the current consumption value CCVa is smaller than the clip-off threshold Th2 (step S106: YES), the sound source LSI 30 generates the clip control signal CCa in accordance with table T2 (step S107).
The sound source LSI 30 outputs the clip control signal CCa generated in step S107 and a main volume signal Va to the class-D amplifier 40a in, for example, I2C format (step S108).
The class-D amplifier 40a amplifies the audio signal input from the sound source LSI in response to the main volume signal Va, and operates the clip circuit 42a based on the clip control signal CCa to clip the audio signal that is the output signal to the speaker SPa. As a result, the clip value for audio signal increases with the passage of time (see, for example, period A4 in
When the current consumption value CCVa is equal to or smaller than the clip-on threshold Th1 and equal to or larger than the clip-off threshold Th2 (step S106: NO), the sound source LSI 30 outputs the main volume signal Va to the class-D amplifier 40a in, for example, I2C format (step S109). The class-D amplifier 40a amplifies the audio signal input from the sound source LSI 30 in response to the main volume signal Va, and outputs the amplified audio signal to the speaker SPa. Even if the audio signal is not clipped, no excessive current flows through the speaker SPa, and thus the speaker SPa is free from the risk of destruction.
The sound source LSI 30 also executes the same clip control CC (steps S103 to S109) for the class-D amplifier 40b.
In brief, when the current consumption value CCVb is larger than the clip-on threshold Th1 (step S103: YES), the sound source LSI 30 generates the clip control signal CCb in accordance with table T1 (step S104). The clip control signal CCb is a control signal for controlling the clip circuit 42b of the class-D amplifier 40b. The sound source LSI 30 outputs the clip control signal CCb generated in step S104 and a main volume signal Vb to the class-D amplifier 40b (step S105). The main volume signal Vb is a signal indicating a main volume value set for the speaker SPb.
When the current consumption value CCVb is smaller than the clip-off threshold Th2 (step S106: YES), the sound source LSI 30 generates the clip control signal CCb in accordance with table T2 (step S107). The sound source LSI 30 outputs the clip control signal CCb generated in step S107 and a main volume signal Vb to the class-D amplifier 40b (step S108).
When the current consumption value CCVb is equal to or smaller than the clip-on threshold Th1 and equal to or larger than the clip-off threshold Th2 (step S106: NO), the sound source LSI 30 outputs the main volume signal Va to the class-D amplifier 40a (step S109).
When the speaker SPa and the speaker SPb (in other words, the rated noise voltage, the maximum input voltage, and the instantaneous maximum input voltage) have the same specification, the clip-on threshold Th1 and the clip-off threshold Th2 for each of the speakers SPa and SPb are set to the same value. On the other hand, when the speaker SPa and the speaker SPb have different specifications, the clip-on threshold Th1 and the clip-off threshold Th2 for each of the speakers SPa and SPb are set to different values.
That is, the internal memory 32 of the sound source LSI 30 stores a plurality of types of clip-on threshold Th1 and clip-off threshold Th2 corresponding to each of a plurality of types of speakers SP. The clip-on threshold Th1 and the clip-off threshold Th2 for each of the plurality of types of speakers SP are set in advance in, for example, the manufacturing stage.
The clip-on threshold Th1 and the clip-off threshold Th2 for each of the plurality of types of speakers SP may be automatically set by the sound source LSI 30 recognizing the model number of the speaker SP. For example, the sound source LSI 30 recognizes the type of the speaker SP as the output destination of the class-D amplifier 40, and sets the clip-on threshold Th1 and the clip-off threshold Th2 according to the type of the recognized speaker SP from among the clip-on thresholds Th1 and the clip-off thresholds Th2 stored in the internal memory 32.
As described above, according to the present embodiment, it is possible to protect the speaker SP while preventing the distortion of the sound due to a high-level output signal such as an attack sound being clipped.
In addition, the present disclosure is not limited to the above-described embodiment, and various modifications can be made without departing from the gist of the present disclosure in the implementation stage. Further, the functions executed in the above-described embodiments may be appropriately combined where appropriate. The above-described embodiment includes various stages, and various inventions can be extracted by appropriately combining a plurality of the disclosed constituent elements. For example, even if some components are deleted from all the components disclosed in the embodiments, a configuration in which the components are deleted can be extracted as an invention as long as the effect can be obtained.
In the above embodiment, the speaker SP is given as an example of the circuit unit to be protected, but the scope of the present disclosure also includes a case where a circuit unit other than the speaker SP (for example, the AC adapter 2) is to be protected. That is, the clip value for the output current of the AC adapter 2 may be decreased with the passage of time when the output current value of the AC adapter 2 is larger than the clip-on threshold Th1, and the clip value for the output current of the AC adapter 2 may be increased with the passage of time when the output current value of the AC adapter 2 is smaller than the clip-off threshold Th2.
The internal memory 32 of the sound source LSI 30 may store a plurality of types of tables T1 and T2 corresponding to the plurality of types of speakers SP. That is, the internal memory 32 may operate as a storage unit for storing a plurality of types of first patterns and second patterns corresponding to the plurality of types of speakers SP, respectively.
In this case, the sound source LSI 30 may obtain tables T1 and T2 according to the type of the speaker SP as the output destination of the class-D amplifier 40 from among the plurality of types of tables T1 and T2 stored in the internal memory 32, and control the clip circuit 42 with the obtained tables T1 and T2. Further, tables T1 and T2 may be set based on the protective curve set in consideration of the safety factor (the thick line in
The internal memory 32 of the sound source LSI 30 may store two functions approximating the respective curves of tables T1 and T2 (see
In another embodiment, the sound source LSI 30 controls the resistance value of the digital potentiometer DPM in accordance with table T1 or T2 when the current consumption value CCV is larger than the clip-on threshold Th1 or smaller than the clip-off threshold Th2. When the voltage division ratio changes as the resistance value of the digital potentiometer DPM changes under the control of the sound source LSI 30, the output voltage of the DC-DC converter 82 installed on the power supply path from the AC adapter 2 to the class-D amplifier 40 changes, and the supply power to the speaker SP changes dynamically.
In another embodiment, similarly to the embodiment described above, the clip value for audio signal, which is the output signal to the speaker SP, decreases with the passage of time or increases with the passage of time. As a result, it is possible to protect the speaker SP while preventing the distortion of the sound due to a high-level output signal such as an attack sound being clipped.
Number | Date | Country | Kind |
---|---|---|---|
2022-092931 | Jun 2022 | JP | national |