CN103795377B - Sinusoidal wave generation method and apparatus and electronic equipment - Google Patents

Sinusoidal wave generation method and apparatus and electronic equipment Download PDF

Info

Publication number
CN103795377B
CN103795377B CN201410016542.8A CN201410016542A CN103795377B CN 103795377 B CN103795377 B CN 103795377B CN 201410016542 A CN201410016542 A CN 201410016542A CN 103795377 B CN103795377 B CN 103795377B
Authority
CN
China
Prior art keywords
sampled point
voltage
output
sampling
sine
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410016542.8A
Other languages
Chinese (zh)
Other versions
CN103795377A (en
Inventor
陈柳章
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Minghua Alliance Technology Co., Ltd.
Original Assignee
Shenzhen Excelsecu Data Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Excelsecu Data Technology Co Ltd filed Critical Shenzhen Excelsecu Data Technology Co Ltd
Priority to CN201410016542.8A priority Critical patent/CN103795377B/en
Publication of CN103795377A publication Critical patent/CN103795377A/en
Application granted granted Critical
Publication of CN103795377B publication Critical patent/CN103795377B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Transmitters (AREA)
  • Telephone Function (AREA)

Abstract

The present invention relates to a kind of sinusoidal wave generation method and apparatus and electronic equipment, according to the voiceband data signal received, obtain frequency and the attenuation rate of sine wave to be generated, obtain the output sampling rate preset and the frequency that gets calculates the sampled point number of this sine wave, the sampling number purpose sampled point of calculating, and the voltage parameter that each sampled point determined is corresponding is determined in the sine table prestored;The output voltage of sampled point is regulated according to the attenuation rate got, voltage parameter and default normal voltage, it is sequentially output the output voltage of each sampled point determined, to form the waveform in a sinusoidal wave cycle, utilize sine wave to carry out the communication of voice data, improve stability and the speed of voice data communication.

Description

Sinusoidal wave generation method and apparatus and electronic equipment
Technical field
The present invention relates to audio signal processing technique field, particularly relate to a kind of sinusoidal wave generate method and apparatus with And electronic equipment.
Background technology
Along with improving constantly of people's living standard, increasing multimedia equipment occurs in common family In the life of front yard.The audio system of music player devices and power amplifying device composition is slowly the most general in family life And, along with people are more and more higher to the prescription playing music, the requirement of the technology of audio system is also got over Come the highest.
But, in present audio system, the general transmission being carried out voice data by the form of square wave, After voice data being encoded when transmission, by pulse width modulation to export the square wave of different cycles Mark 0 and 1, carries out data communication.When utilizing square wave to communicate, signal quality is poor, causes communication Unstable and that traffic rate is slower situation.
Summary of the invention
The main object of the present invention is to provide a kind of sinusoidal wave generation method and apparatus and electronic equipment, purport Improving stability and the speed of voice communication.
The present invention proposes a kind of sinusoidal wave generation method, including:
According to the voiceband data signal received, obtain frequency and the attenuation rate of sine wave to be generated;
The sampled point number of this sine wave is calculated according to default output sampling rate and the frequency that gets;
The sampling number purpose sampled point of calculating, and each sampling determined is determined in the sine table prestored The voltage parameter that point is corresponding;
The output of sampled point is regulated according to the attenuation rate got, voltage parameter and default normal voltage Voltage, is sequentially output the output voltage of each sampled point determined, to form sine wave.
Preferably, carry out sampling to obtain often in the sine table prestored according to the sampled point number got The step of the voltage parameter of individual sampled point includes:
Determine the sampling number purpose sampled point of calculating at the sine table equal intervals prestored, and each determines Voltage parameter corresponding to sampled point.
Preferably, described voltage parameter is the ratio between voltage and the normal voltage of each sampled point.
The present invention also proposes a kind of sinusoidal wave generating means, including:
Acquisition module, for according to the voiceband data signal received, obtaining the frequency of sine wave to be generated And attenuation rate;
Computing module, for calculating this sine wave according to the output sampling rate preset and the frequency got Sampled point number;
Described acquisition module is additionally operable to determine the sampling number purpose sampling of calculating in the sine table prestored Point, and the voltage parameter that each sampled point determined is corresponding;
Output module, for adjusting according to the attenuation rate got, voltage parameter and default normal voltage The output voltage of joint sampled point, is sequentially output the output voltage of each sampled point determined, to form sine Ripple.
Preferably, described acquisition module is specifically for determining adopting of calculating at the sine table equal intervals prestored Number of samples purpose sampled point, and the voltage parameter that each sampled point determined is corresponding.
Preferably, described voltage parameter is the ratio between voltage and the normal voltage of each sampled point.
The present invention also proposes a kind of electronic equipment, mike, sinusoidal wave generating means as described above, First load and the second load;Wherein, the outfan of described sinusoidal wave generating means divides two-way, a road Be connected with described mike through described first load, another road through described second carrying ground, described first The resistance of load is more than the resistance of the second load.
Preferably, the resistance of described first load is the described second load resistance 5 times.
The sine wave that the present invention proposes generates method and apparatus and electronic equipment, according to the audio frequency received Data signal, obtains frequency and the attenuation rate of sine wave to be generated, obtain the output sampling rate preset with And the frequency got calculates the sampled point number of this sine wave, in the sine table prestored, determine calculating Sampling number purpose sampled point, and the voltage parameter that each sampled point determined is corresponding;According to get Attenuation rate, voltage parameter and the output voltage of default normal voltage regulation sampled point, be sequentially output each The output voltage of the individual sampled point determined, to form the waveform in a sinusoidal wave cycle, utilizes sine wave Carry out the communication of voice data, improve stability and the speed of voice data communication.
Accompanying drawing explanation
Fig. 1 is the high-level schematic functional block diagram that sine wave of the present invention generates method preferred embodiment;
Fig. 2 is the high-level schematic functional block diagram of sine wave generating means preferred embodiment of the present invention;
Fig. 3 is that the structure of the preferred embodiment of the electronic equipment including the sinusoidal wave generating means shown in Fig. 2 is shown It is intended to.
The realization of the object of the invention, functional characteristics and advantage will in conjunction with the embodiments, do referring to the drawings further Explanation.
Detailed description of the invention
Below in conjunction with the accompanying drawings and specific embodiment is described further with regard to technical scheme.Should Understanding, specific embodiment described herein only in order to explain the present invention, is not intended to limit the present invention.
It is the high-level schematic functional block diagram that sine wave of the present invention generates method preferred embodiment with reference to Fig. 1, Fig. 1.
The present embodiment proposes a kind of sinusoidal wave generation method, including:
Step S10, according to the voiceband data signal received, obtains the frequency of sine wave to be generated and declines Lapse rate;
This voiceband data signal can be square-wave signal, it is possible to for digital signal;Voice data letter when input When number being square-wave signal, the frequency of this sine wave to be generated and attenuation rate are the square-wave signal received Frequency and attenuation rate;When voiceband data signal is digital signal, extract to be generated from this digital signal Become sinusoidal wave frequency and attenuation rate.
Step S20, calculates the sampling of this sine wave according to default output sampling rate and the frequency that gets Count out;
In the present embodiment, the sample rate preset is preferably the sample rate of the mike of terminal, general wheat The sample rate of gram wind is 44.1KHZ, in order to meet the sine wave of output, and the terminal energy at this mike place Enough normal parsings, then the output sampling rate preset should be not less than 44.1KHZ.
In the present embodiment, arranging output sampling rate is F, and sinusoidal wave frequency to be generated is f, then adopt The computing formula of sampling point number N is: N=F/f.Such as output sampling rate F is 50KHZ, to be generated Sinusoidal wave frequency f is 5KHZ, then sampled point number is 10, adopts according to 10 of 50KHZ output Sampling point constitutes a sinusoidal wave cycle, and the frequency of this sine wave is 5KHZ.
Step S30, determines the sampling number purpose sampled point of calculating in the sine table prestored, and each is true The voltage parameter that fixed sampled point is corresponding;
Step S40, regulates sampling according to the attenuation rate got, voltage parameter and default normal voltage The output voltage of point, is sequentially output the output voltage of each sampled point determined, to form sine wave.
The size of sine table is 100 in the present embodiment, can determine 100 sampled points in sine table, Each sampled point storage has the voltage parameter of this sampled point, this voltage parameter be each sampled point voltage with Ratio between normal voltage.In the present embodiment, when the voltage parameter that each sampled point of acquisition is corresponding, Preferred version is, determines the sampling number purpose sampled point of calculating at the sine table equal intervals prestored, and The voltage parameter that each sampled point determined is corresponding, such as sampled point number are 10, and the size of sine table When being 100, then can take a sampled point every 10 points, more stable to guarantee the sine wave generated, And it is smooth.In other variant embodiment, it is possible to be spaced in sine table extraction sampling according to default The voltage parameter of point.In the present embodiment, the size arranging sine table is K, then for ensureing just generating String ripple is more complete and stable, then 4≤N≤K.
In the present embodiment, normal voltage is the amplitude peak of maximum sine wave to be output, the most to be output Sinusoidal wave amplitude is 0-3.3V, then this normal voltage is 3.3V;If the voltage of the sampled point of output is 3V, And normal voltage is 3.3V, now the voltage parameter of this sampled point is Nx=3/3.3=0.9.At the present embodiment In, the analogue signal that normal voltage exports with the precision of 12bit identifies with 0x3ff, and Nx represents sampled point Voltage parameter, then the output voltage of sampled point is V=Nx × 0x3ff.
After determining the output voltage of each sampled point, need according to the attenuation rate got this sampled point Output point sample be adjusted, more true to ensure the sine wave signal that each sampled point formed, signal Better quality, now needs to adjust according to the attenuation rate got, voltage parameter and default normal voltage The output voltage of joint sampled point, is sequentially output the output voltage of each sampled point determined, to form sine Ripple, in the present embodiment, if this sine wave signal maximum amplitude value is 3.3V, for ensureing the sine of output Ripple is more smooth and true, then forming the sampled point in sinusoidal wave each cycle needs more than 4, then each is adopted The rate of signal attenuation of sampling point should be less than 0x3ff/4.
If the attenuation rate arranging sine wave is D, the voltage parameter of sampled point is Nx, and normal voltage is with 12bit Precision output analogue signal with 0x3ff identify, the output voltage of the most each sampled point be V1=Nx × 0x3ff/D, in the present embodiment, the sampling number purpose sampled point that output gets, constitute sine wave One cycle.
The sinusoidal wave generation method that the present embodiment proposes, according to the voiceband data signal received, acquisition is treated Generate sinusoidal wave frequency and attenuation rate, obtain the output sampling rate preset and the cymometer got Calculate the sampled point number of this sine wave, the sine table prestored determines the sampling number purpose sampling of calculating Point, and the voltage parameter that each sampled point determined is corresponding;According to the attenuation rate got, voltage parameter And the output voltage of the normal voltage regulation sampled point preset, it is sequentially output each sampled point determined Output voltage, to form the waveform in a sinusoidal wave cycle, utilizes sine wave to carry out the logical of voice data Letter, improves stability and the speed of voice data communication.
With reference to the high-level schematic functional block diagram that Fig. 2, Fig. 2 are sine wave generating means preferred embodiment of the present invention.
The present embodiment proposes a kind of sinusoidal wave generating means, including:
Acquisition module 10, for according to the voiceband data signal received, obtaining the frequency of sine wave to be generated Rate and attenuation rate;
This voiceband data signal can be square-wave signal, it is possible to for digital signal;Voice data letter when input When number being square-wave signal, the frequency of this sine wave to be generated and attenuation rate are the square-wave signal received Frequency and attenuation rate;When voiceband data signal is digital signal, extract to be generated from this digital signal Become sinusoidal wave frequency and attenuation rate.
Computing module 20, for calculating this sine according to the output sampling rate preset and the frequency got The sampled point number of ripple;
In the present embodiment, the sample rate preset is preferably the sample rate of the mike of terminal, general wheat The sample rate of gram wind is 44.1KHZ, in order to meet the sine wave of output, and the terminal energy at this mike place Enough normal parsings, then the output sampling rate preset should be not less than 44.1KHZ.
In the present embodiment, arranging output sampling rate is F, and sinusoidal wave frequency to be generated is f, then adopt The computing formula of sampling point number N is: N=F/f.Such as output sampling rate F is 50KHZ, to be generated Sinusoidal wave frequency f is 5KHZ, then sampled point number is 10, adopts according to 10 of 50KHZ output Sampling point constitutes a sinusoidal wave cycle, and the frequency of this sine wave is 5KHZ.
Described acquisition module 30 is additionally operable to determine the sampling number purpose sampling of calculating in the sine table prestored Point, and the voltage parameter that each sampled point determined is corresponding;
Output module 30, for according to attenuation rate, voltage parameter and the default normal voltage got The output voltage of regulation sampled point, is sequentially output the output voltage of each sampled point determined, just to be formed String ripple.
The size of sine table is 100 in the present embodiment, can determine 100 sampled points in sine table, Each sampled point storage has the voltage parameter of this sampled point, this voltage parameter be each sampled point voltage with Ratio between normal voltage.In the present embodiment, when the voltage parameter that each sampled point of acquisition is corresponding, Preferred version is, determines the sampling number purpose sampled point of calculating at the sine table equal intervals prestored, and The voltage parameter that each sampled point determined is corresponding, such as sampled point number are 10, and the size of sine table When being 100, then can take a sampled point every 10 points, more stable to guarantee the sine wave generated, And it is smooth.In other variant embodiment, it is possible to be spaced in sine table extraction sampling according to default The voltage parameter of point.In the present embodiment, the size arranging sine table is K, then for ensureing just generating String ripple is more complete and stable, then 4≤N≤K.
In the present embodiment, normal voltage is the amplitude peak of maximum sine wave to be output, the most to be output Sinusoidal wave amplitude is 0-3.3V, then this normal voltage is 3.3V;If the voltage of the sampled point of output is 3V, And normal voltage is 3.3V, now the voltage parameter of this sampled point is Nx=3/3.3=0.9.At the present embodiment In, the analogue signal that normal voltage exports with the precision of 12bit identifies with 0x3ff, and Nx represents sampled point Voltage parameter, then the output voltage of sampled point is V=Nx × 0x3ff.
After determining the output voltage of each sampled point, need according to the attenuation rate got this sampled point Output point sample be adjusted, more true to ensure the sine wave signal that each sampled point formed, signal Better quality, now needs to adjust according to the attenuation rate got, voltage parameter and default normal voltage The output voltage of joint sampled point, is sequentially output the output voltage of each sampled point determined, to form sine Ripple, in the present embodiment, if this sine wave signal maximum amplitude value is 3.3V, for ensureing the sine of output Ripple is more smooth and true, then forming the sampled point in sinusoidal wave each cycle needs more than 4, then each is adopted The rate of signal attenuation of sampling point should be less than 0x3ff/4.
If the attenuation rate arranging sine wave is D, the voltage parameter of sampled point is Nx, and normal voltage is with 12bit Precision output analogue signal with 0x3ff identify, the output voltage of the most each sampled point be V1=Nx × 0x3ff/D, in the present embodiment, the sampling number purpose sampled point that output gets, constitute sine wave One cycle.
The sinusoidal wave generating means that the present embodiment proposes, according to the voiceband data signal received, acquisition is treated Generate sinusoidal wave frequency and attenuation rate, obtain the output sampling rate preset and the cymometer got Calculate the sampled point number of this sine wave, the sine table prestored determines the sampling number purpose sampling of calculating Point, and the voltage parameter that each sampled point determined is corresponding;According to the attenuation rate got, voltage parameter And the output voltage of the normal voltage regulation sampled point preset, it is sequentially output each sampled point determined Output voltage, to form the waveform in a sinusoidal wave cycle, utilizes sine wave to carry out the logical of voice data Letter, improves stability and the speed of voice data communication.
With reference to the preferable enforcement that Fig. 3, Fig. 3 are the electronic equipment including the sinusoidal wave generating means shown in Fig. 2 The structural representation of example.
The present embodiment proposes a kind of electronic equipment, including mike 40, sine as described above in Example Ripple generating means 50, first loads R1 and second load R2;Wherein, described sinusoidal wave generating means The outfan of 50 divides two-way, and a road loads R1 through described first and is connected with described mike 40, another road R2 ground connection is loaded through described second.
Owing to sinusoidal wave generating means 50 can disturb the static work of mike 40 when sine wave output signal Make a little, and when sinusoidal wave generating means 50 output amplitude is excessive, be likely to result in mike 40 nothing Method identification.For solving above-mentioned technical problem, the present embodiment is arranged at the outfan of sinusoidal wave generating means 50 Shunt circuit, arranges the first load R1 and second load R2, and the first load R1 is more than the second load R2, in the present embodiment, the first load R1 is preferably 5 times of the second load R2, the most sinusoidal wave defeated The electric current major part going out device 50 output flows out through the second load R2 so that the electricity of mike 40 end change Press the least, both avoided mike 40 nonrecognition, and do not interfered with again the quiescent point of mike 40.
The foregoing is only the preferred embodiments of the present invention, not thereby limit the scope of the claims of the present invention, Every equivalent structure transformation utilizing description of the invention and accompanying drawing content to be made, or directly or indirectly use In the technical field that other are relevant, the most in like manner it is included in the scope of patent protection of the present invention.

Claims (8)

1. a sinusoidal wave generation method, is characterised by, including:
According to the voiceband data signal received, obtain frequency and the attenuation rate of sine wave to be generated;
The sampled point number of this sine wave is calculated according to default output sampling rate and the frequency that gets;
The sampling number purpose sampled point of calculating, and each sampling determined is determined in the sine table prestored The voltage parameter that point is corresponding;
The output of sampled point is regulated according to the attenuation rate got, voltage parameter and default normal voltage Voltage, is sequentially output the output voltage of each sampled point determined, to form sine wave.
Method the most according to claim 1, it is characterised in that according to the sampled point number got The step carrying out sampling to obtain the voltage parameter of each sampled point in the sine table prestored includes:
Determine the sampling number purpose sampled point of calculating at the sine table equal intervals prestored, and each determines Voltage parameter corresponding to sampled point.
Method the most according to claim 1, it is characterised in that described voltage parameter is each sampling Ratio between voltage and the normal voltage of point.
4. a sinusoidal wave generating means, it is characterised in that including:
Acquisition module, for according to the voiceband data signal received, obtaining the frequency of sine wave to be generated And attenuation rate;
Computing module, for calculating this sine wave according to the output sampling rate preset and the frequency got Sampled point number;
Described acquisition module is additionally operable to determine the sampling number purpose sampling of calculating in the sine table prestored Point, and the voltage parameter that each sampled point determined is corresponding;
Output module, for adjusting according to the attenuation rate got, voltage parameter and default normal voltage The output voltage of joint sampled point, is sequentially output the output voltage of each sampled point determined, to form sine Ripple.
Device the most according to claim 4, it is characterised in that described acquisition module specifically for The sine table equal intervals prestored determines the sampling number purpose sampled point of calculating, and each sampling determined The voltage parameter that point is corresponding.
Sinusoidal wave generating means the most according to claim 4, it is characterised in that described voltage parameter For the ratio between voltage and the normal voltage of each sampled point.
7. an electronic equipment, it is characterised in that mike, sine wave as described in claim 4-6 Generating means, the first load and the second load;Wherein, the outfan of described sinusoidal wave generating means divides Two-way, a road through described first load be connected with described mike, another road through described second carrying ground, The resistance of described first load is more than the resistance of the second load.
Electronic equipment the most according to claim 7, it is characterised in that the resistance of described first load For described second load resistance 5 times.
CN201410016542.8A 2014-01-14 2014-01-14 Sinusoidal wave generation method and apparatus and electronic equipment Active CN103795377B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410016542.8A CN103795377B (en) 2014-01-14 2014-01-14 Sinusoidal wave generation method and apparatus and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410016542.8A CN103795377B (en) 2014-01-14 2014-01-14 Sinusoidal wave generation method and apparatus and electronic equipment

Publications (2)

Publication Number Publication Date
CN103795377A CN103795377A (en) 2014-05-14
CN103795377B true CN103795377B (en) 2016-08-24

Family

ID=50670748

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410016542.8A Active CN103795377B (en) 2014-01-14 2014-01-14 Sinusoidal wave generation method and apparatus and electronic equipment

Country Status (1)

Country Link
CN (1) CN103795377B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1666407A (en) * 2002-07-08 2005-09-07 索尼株式会社 Waveform generating device and method, and decoder
KR100676376B1 (en) * 2006-08-18 2007-02-01 (주)한성월드칸 Sine wave generator for extending the performances of an alternator and method thereof

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1666407A (en) * 2002-07-08 2005-09-07 索尼株式会社 Waveform generating device and method, and decoder
KR100676376B1 (en) * 2006-08-18 2007-02-01 (주)한성월드칸 Sine wave generator for extending the performances of an alternator and method thereof

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
《基于DSP的正弦信号发生方法》;李爱华;《江苏电器》;20080530;7-9,25 *
《软件正弦波音频信号发生器的设计》;杨宗长;《电声技术》;20040130;35-36 *

Also Published As

Publication number Publication date
CN103795377A (en) 2014-05-14

Similar Documents

Publication Publication Date Title
ATE396544T1 (en) SIGNAL SCALING CIRCUIT WITH SWITCHED CAPACITIES
CN103973231B (en) Voltage adjustment circuit of amplification circuit and related adjustment method
CN203416230U (en) Filter
CN203466791U (en) Signal waveform conversion circuit and device thereof
CN103795377B (en) Sinusoidal wave generation method and apparatus and electronic equipment
JP2013034188A5 (en)
CN104124952B (en) A kind of recognizable key circuit
CA2516396A1 (en) Method of programming a hearing aid by a programming device
CN206313977U (en) Plosive eliminating device and power amplifier circuit
CN205051664U (en) Filter
EP2629105A3 (en) Method for performing a tri-state comparison of two input signals and window comparator circuit
CN101685111A (en) Novel zero crossing detection circuit
CN203734823U (en) Audio device
CN206196037U (en) Electrodeless adjusting module of microphone signal
CN106162485A (en) Novel earphone impedance detection system, method and portable electric appts
CN205670837U (en) A kind of audio protection circuit
CN203054096U (en) Apparatus for calibrating pulse current
CN204929259U (en) Debugging device of making an uproar falls in bluetooth headset
CN105978551B (en) A kind of chaos circuit
CN202696864U (en) Microphone (MIC) module in learning machine circuit
CN205040002U (en) Can clone effect ware of tone quality
CN204697020U (en) A kind of dual output constant current-supplying circuit for preamplifier
CN203026137U (en) Portable electronic device
CN207319385U (en) A kind of wireless vibration sensing device
CN104850280B (en) Digital independent apparatus and method and data link and method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20170405

Address after: 100000 room 703-710, room B3, Huayuan Road, Haidian District, Beijing, 7

Patentee after: Beijing Minghua Alliance Technology Co., Ltd.

Address before: 518057 Guangdong city of Shenzhen province Nanshan District Ke Feng Lu No. 2 idiopathic information building A building unit seven floor South 701-709

Patentee before: Shenzhen Wendingchuang Data Technology Co., Ltd.

TR01 Transfer of patent right