A program for generating sound of different frequencies. Sound card as a generator

DI HALT:
The method is perverse, to be honest, I would quickly assemble a signal generator of the desired shape on R2R. But it happens that sometimes one is not there, then the other, but there is almost always overwhelmed computer junk.

Disclaimer:
I want to warn you right away that barbaric manipulations with a computer immediately cover the guarantee for iron with a fur organ, and with a small radius of curvature of the arms - the entire computer or with important parts. If you doubt the firmness of your hand and your capabilities, then it is better to collect Frankenstein from the trash purely for experiments.

I needed to debug one device on an AVR microcontroller. More precisely, receiving data from the ADC. When the signal of this data should be ultra-low frequency, about 1 Hz. Oddly enough, it is rather difficult to receive a signal of such a frequency by standard means. Sound card at the output has filters that do not allow such a low-frequency signal to break through. Therefore, a decision was made to upgrade the sound card.

In order not to risk it, it was decided to implement this on an external sound card. But this experience is true for the built-in sound cards, but it is worthy of the Jedi.

A sound card was bought with a hammer Sound Blaster Live... After a quick look, it became clear that it is impossible to understand the circuitry of a 4-layer board without good grass. But it is quite obvious that all output and input analog signals first go to the op-amp, and then to the DAC / ADC. Well OU googled quickly. Then I drew attention to the microcircuit, which roughly receives all the signals. She was the second largest. I drove the labeling into Google, and lo and behold! Found a datasheet!

Chip pinout.

We are interested in the DAC line output (underlined in red). I selected only the right channel. If someone decides to make an oscilloscope, then they will need to solder to the line input (blue rectangle). Of course, through the appropriate decoupling scheme (which is googled on the Internet).
In order not to burn the DAC with my hellish experiments, I decided to protect it a little. And I recommend making such a scheme without fail.

Soldered resistor

To output the signal from the computer, I used the VGA connector, which by some miracle was lying around in my desk. Why this wire is good: it has 5 separately shielded wires. I just started a wire on 1 pin (RED signal). Since the screens of all signals are connected to the ground and so, I did not bother with the output of the ground. Of course, ideally, you need to output the analog ground of the sound card (where it is, it looks in the datasheet for the same microcircuit), but I was broke.

Installed sound, and the socket of our generator

As a generator, I use a primitive "Tone Generator" program that can be downloaded from here. It allows you to generate a sine, saw, square wave, white noise and some strange signal.

Which is quite enough for my purposes.
After it was installed in the computer, I decided to make sure that the generation was going on with an oscilloscope, and I soldered it correctly.

Pure sine of our generator.

Well, the offset without a capacitor, my DAC has about 2 volts. Let's check how the ADC of my microcontroller eats.

A generator, and a program that reads the ADC values \u200b\u200bof the microcontroller.

Do not pay attention to the fact that the sine taken by the controller is so broken - there is a very small sampling rate.
To shift the zero point, as well as reduce the signal amplitude by half, you need to put one 10 k resistor to ground. Thus, together with the resistor, a voltage divider is formed on the sound card.

For sim I bow, successful experiments.

An application that allows you to transmit sound of different frequencies through several channels is indispensable when setting up professional music systems.

Sound frequency generator - the name of the program speaks for itself. There is another name for the "Sound Generator" application. The system allows you to transmit sound with the additional ability to customize the signal characteristics. An important plus of the application is the ability to multichannel sound transmission. When the generator is turned on, nine separate panels light up with the function of a possible frequency setting for each channel. Their location can be changed or docked in the desktop area.

Application characteristics

The sound application is compatible with 24- and 32-bit cards, and the sampling rate must be 384 kHz. Transmission of noise and harmonic sinusoidal signals is possible. Changing the audio phases is easy by mechanically switching the system. These functions are often used when using professional equipment.
Sound frequency generator is a highly targeted application. This is due to the following functions:
  • The frequency range is not limited, depends on technical capabilities sound system;
  • the generator provides for the operation of two or more oscillators with the function of simultaneously changing the characteristics of sound transmission;
  • modes of reproduction of Brownian, white and pink noises, as well as transmission of amplitude modulation and swinging frequency of electrical oscillations are provided;
  • the audio application has the lowest distortion percentage;
  • the processed sound can be saved to your computer.
The developers have equipped new variations of the program with templates with preset sound characteristics. It is enough to find a ready-made preset on the desktop and start it by double-clicking the left key. The sound generator is not whimsical to use. The only downside is that the free version of the program is a trial version, and its sounding lasts about twenty seconds. For the application to work properly, you need to buy a license.

To play a constant tone, click Play or press Space.

To change the frequency, drag the slider or press ← → (arrow keys). To adjust the frequency by 1 Hz, use the buttons or press Shift + ← and Shift + →. To adjust the frequency by 0.01 Hz, press Ctrl + ← and Ctrl + →; to adjust it by 0.001 Hz, press Ctrl + Shift + ← and Ctrl + Shift + → To halve / double the frequency (go down / up one octave), click × ½ and × 2.

To change the wave type from a sine wave (pure tone) to a square / triangle / sawtooth wave, click the button.

You can mix tones by opening the Online Tone Generator in several browser tabs.

What can I use this tone generator for?

Tuning instruments, science experiments ( what’s the resonant frequency of this wineglass?), testing audio equipment ( how low does my subwoofer go?), testing your hearing ( what’s the highest frequency you can hear? are there frequencies you can hear in only one ear?).

Tinnitus frequency matching. If you have pure-tone, this online frequency generator can help you determine its frequency. Knowing your tinnitus frequency can enable you to better target masking sounds and. When you find a frequency that seems to match your tinnitus, make sure you check frequencies one octave higher (frequency × 2) and one octave lower (frequency × 1/2), as it is easy to confuse tones that are one octave apart.

Alzheimer's disease. There is some early-stage scientific evidence that listening to a can reverse some of the molecular changes in the brains of Alzheimer’s patients. This is one of these things that sound too good to be true, but early results are very promising. Here’s a and a report from a user who tried 40 Hz therapy on his wife. ( Note that this tone generator is not a medical device - I don’t guarantee anything!)

Comments

Support this site

If you use the Online Tone Generator and find it helpful, please support it with a little bit of money. Here's the deal: My goal is to keep maintaining this site to make sure it stays compatible with current browser versions. Unfortunately, this takes a non-trivial amount of time (for example, figuring out an obscure browser bug can take many hours of work), which is a problem because I have to make a living. Donations from awesome, good-looking users like you buy me time to keep things running.

So if you think this tone generator is worth it, please support it with some money to help keep it online. The amount is entirely up to you - I only ask for what you consider fair price for the value you're getting. Thanks!

SoundCard Oszilloscope - software that turns a computer into a dual-channel oscilloscope, dual-channel low frequency generator and spectrum analyzer

Good day, dear radio amateurs!
Every radio amateur knows that to create more or less complex radio amateur devices, you must have at your disposal not only a multimeter. Today in our stores you can buy almost any device, but - there is one "but" - the cost of a decent quality of any device is not less than several tens of thousands of our rubles, and it is no secret that for most Russians this is a lot of money, and therefore these devices are not available at all, or a radio amateur buys devices that have been in use for a long time.
Today on the site , we will try to equip the radio amateur's laboratory with free virtual instruments -digital two-channel oscilloscope, two-channel audio frequency generator, spectrum analyzer... The only drawback of these devices is that they all work only in the frequency range from 1 Hz to 20,000 Hz. The site has already given a description of a similar radio amateur program:“ “ - program converting home computer to the oscilloscope.
Today I want to bring to your attention another program - “SoundCard Oszilloscope“. I was attracted by this program for its good characteristics, thoughtful design, ease of study and work in it. This program is in English, there is no Russian translation. But I do not consider this a disadvantage. Firstly, it is very easy to figure out how to work in the program, you will see it yourself, and secondly - someday you will acquire good devices (and they have all the notation in English, although they are Chinese) and immediately and easily get used to them.

The program was developed by C. Zeitnitz and is free, but only for private use. The license for the program costs about 1,500 rubles, and there is also a so-called "private license" - about 400 rubles, but this is rather a donation to the author for further improving the program. Naturally, we will use the free version of the program, which differs only in that every time it is launched, a window appears with an offer to buy a license.

Download the program (latest version for December 2012):

(28.1 MiB, 54,367 hits)

First, let's understand the “concepts”:
Oscilloscope - a device designed for research, observation, measurement of amplitude and time intervals.
Oscilloscopes are classified:
by purpose and method of displaying information:
- oscilloscopes with periodic sweep for observing signals on the screen (in the West they are called oscilloscop)
- continuous-sweep oscilloscopes for recording the signal curve on a photographic tape (in the West they are called oscillograph)
by the method of processing the input signal:
- analog
- digital

The program works in an environment not lower than W2000 and includes:
- a two-channel oscilloscope with a transmission frequency (depending on the sound card) not less than 20 to 20,000 Hz;
- two-channel signal generator (with the same generated frequency);
- spectrum analyzer
- and it is also possible to record a sound signal for its subsequent study

Each of these programs has additional features, which we will look at as we study them.

We'll start with a Signalgenerator:

The signal generator, as I said, is two-channel - Channel 1 and Channel 2.
Let's consider the purpose of its main switches and windows:
1 buttons for turning on generators;
2 output waveform setting window:
sine - sinusoidal
triangle- triangular
square- rectangular
sawtooth- sawtooth
white noise - White noise
3 output signal amplitude regulators (maximum - 1 volt);
4 frequency adjustment knobs (the desired frequency can be set manually in the windows under the knobs). Although the maximum frequency on the regulators is 10 kHz, in the lower windows you can register any allowable frequency (depending on the sound card);
5 windows for setting the frequency manually;
6 switching on the “Sweep - generator” mode. In this mode, the output frequency of the generator periodically changes from the minimum value set in the windows "5" to maximum value set in the “Fend” boxes for the time set in the “Time” boxes. This mode can be enabled either for any one channel or for two channels at once;
7 windows for setting the final frequency and time of the Sweep mode;
8 software connection generator channel output to the first or second input channel of the oscilloscope;
9 - setting the phase difference between the signals from the first and second channels of the generator.
10 - atsetting the duty cycle of the signal (valid only for a square wave).

Now let's take a look at the oscilloscope itself:

1 Amplitude - adjustment of the sensitivity of the vertical deflection channel
2 Sync - allows (by checking or unchecking the checkbox) to make separate, or simultaneous adjustment of two channels in terms of signal amplitude
3, 4 allows to spread signals along the height of the screen for their individual observation
5 setting the sweep time (from 1 millisecond to 10 seconds, with 1000 milliseconds in 1 second)
6 start / stop oscilloscope operation. When stopped, the current state of the signals is saved on the screen, and the Save button appears ( 16 ) that allows you to save the current state on the computer in the form of 3 files (text data of the signal under investigation, black and white image and color image of the picture from the oscilloscope screen at the time of stopping)
7 Trigger - a software device that delays the start of the sweep until certain conditions are met and serves to obtain a stable image on the oscilloscope screen. There are 4 modes:
on / off... When the trigger is off, the image on the screen will appear “running” or even “blurry”.
auto mode... The program itself chooses the mode (normal or single).
normal mode... In this mode, a continuous sweep of the signal under investigation is carried out.
single mode... In this mode, a one-time signal sweep is performed (with a time interval set by the Time knob).
8 active channel selection
9 Edge - signal trigger type:
- rising - on the front of the signal under investigation
falling - by the decay of the investigated signal
10 Auto Set - automatic setting of the sweep time, the sensitivity of the vertical deflection channel Amplitude, as well as the image is driven to the center of the screen.
11 - Channel Mode - determines how the signals will be displayed on the oscilloscope screen:
single - separate output of two signals to the screen
- CH1 + CH2 - output of the sum of two signals
CH1 - CH2 - output of the difference of two signals
CH1 * CH2 - output of the product of two signals
12 and 13selection of the display of channels on the screen (or either of the two, or two at once, the value is displayed next to Amplitude)
14 waveform output of channel 1
15 waveform output of channel 2
16 have already passed - recording a signal to a computer in the oscilloscope stop mode
17 time scale (we have a regulator Time stands at 10 milliseconds, so the scale is displayed from 0 to 10 milliseconds)
18 Status - shows the current state of the trigger and also allows you to display the following data:
- HZ and Volts - display of the current frequency of the voltage of the signal under investigation
cursor - turning on vertical and horizontal cursors to measure the parameters of the signal under investigation
log to Fille - per second recording of the parameters of the signal under study.

Taking measurements on an oscilloscope

First, let's set up the signal generator:

1. Turn on channel 1 and channel 2 (green triangles light up)
2. Set the output signals - sinusoidal and rectangular
3. Set the amplitude of the output signals equal to 0.5 (the generator generates signals with a maximum amplitude of 1 volt, and 0.5 will mean the amplitude of the signals equal to 0.5 volts)
4. Set the frequency to 50 Hertz
5. Go to the oscilloscope mode

Signal amplitude measurement:

1. The button under the inscription Measure select the mode HZ and Volts, put a tick next to the labels Frequency and Voltage... At the same time, the current frequencies for each of the two signals (almost 50 hertz) appear from above, the amplitude of the total signal Vp-p and effective signal voltage Veff.
2. The button under the inscription Measure select the mode Cursors and put a tick next to the inscription Voltage... In this case, we have two horizontal lines, and at the bottom of the inscriptions showing the amplitude of the positive and negative signal components ( AND), as well as the total signal amplitude swing ( dA).
3. We expose horizontal lines in the position we need relative to the signal, on the screen we will receive data on their amplitude:

Measuring time intervals:

We carry out the same operations as for measuring the signal amplitude, except in the mode Cursors put a tick at the inscription Time... As a result, instead of horizontal, we will get two vertical lines, and the time interval between the two vertical lines and the current signal frequency in this time interval will be displayed below:

Determination of signal frequency and amplitude

In our case, there is no need to specifically calculate the frequency and amplitude of the signal - everything is displayed on the oscilloscope screen. But if you have to use an analog oscilloscope for the first time in your life and you do not know how to determine the frequency and amplitude of the signal, we will consider this issue for educational purposes.

We leave the generator settings as they were, with the exception that the signal amplitude is set to 1.0, and the oscilloscope settings are set as in the picture:

We set the signal amplitude regulator to 100 millivolts, the sweep time regulator to 50 milliseconds, and we get the picture on the screen as from above.

Signal amplitude determination principle:
Regulator Amplitude we stand in position 100 millivolts, which means that the vertical division of the grid on the oscilloscope screen is 100 millivolts. We count the number of divisions from the bottom of the signal to the upper (we get 10 divisions) and multiply by the price of one division - 10 * 100 \u003d 1000 millivolts \u003d 1 volt, which means that the amplitude of the signal from the top to the bottom is 1 volt. In the same way, you can measure the signal amplitude at any part of the oscillogram.

Determination of signal timing:
Regulator Time we stand in position 50 milliseconds... The number of horizontal divisions of the oscilloscope scale is 10 (in this case, we have 10 divisions on the screen), divide 50 by 10 and get 5, which means that the price of one division will be 5 milliseconds. We select the desired section of the signal oscillogram and calculate how many divisions it fits (in our case, 4 divisions). Multiply the price of 1 division by the number of divisions 5*4=20 and determine that the period of the signal in the investigated area is 20 milliseconds.

Determination of the signal frequency.
The frequency of the signal under investigation is determined by the usual formula. We know that one period of our signal is equal to 20 milliseconds, it remains to find out how many periods will be in one second- 1 second / 20 milliseconds \u003d 1000/20 \u003d 50 Hertz.

Spectrum analyzer

Spectrum analyzer - a device for observing and measuring the relative distribution of the energy of electrical (electromagnetic) oscillations in the frequency band.
Low frequency spectrum analyzer (as in our case) is designed to work in the audio frequency range and is used, for example, to determine the frequency response various devices, when studying the characteristics of noise, tuning various radio equipment. Specifically, we can determine the frequency response of the assembled audio amplifier, set up various filters, etc.
There is nothing difficult in working with the spectrum analyzer, below I will give the purpose of its main settings, and you yourself, already empirically, will easily figure out how to work with it.

This is what the spectrum analyzer looks like in our program:

What's here - what:

1. View of the vertical scale of the analyzer
2. Selecting the displayed channels from the generator often and the type of display
3. Working part of the analyzer
4. Button for recording the current state of the waveform when stopped
5. Mode of increasing the working area
6. Switching the horizontal scale (frequency scale) from linear to logarithmic form
7. Current signal frequency when the generator is in sweep mode
8. Current frequency at cursor position
9. Signal harmonic distortion indicator
10. Setting the filter for signals by frequency

Viewing Lissajous figures

Lissajous figures - closed trajectories, drawn by a point performing simultaneously two harmonic oscillations in two mutually perpendicular directions. The type of figures depends on the relationship between periods (frequencies), phases and amplitudes of both oscillations.

If you apply to the inputs " X"And" Y»Oscilloscope signals of close frequencies, then on the screen you can see the figures of Lissajous. This method is widely used to compare the frequencies of two signal sources and to match one source to the frequency of the other. When the frequencies are close, but not equal to each other, the figure on the screen rotates, and the period of the rotation cycle is the reciprocal of the frequency difference, for example, the rotation period is 2 s - the difference in signal frequencies is 0.5 Hz. With equal frequencies, the figure freezes motionless, in any phase, however, in practice, due to short-term signal instabilities, the figure on the oscilloscope screen usually shakes slightly. You can use for comparison not only the same frequencies, but also those in a multiple ratio, for example, if an exemplary source can only produce 5 MHz, and a tunable source - 2.5 MHz.

I'm not sure if this function of the program will be useful to you, but if you suddenly need it, then I think that you can easily figure out this function on your own.

Sound recording function

I have already said that the program allows you to record any sound signal on a computer for the purpose of its further study. The signal recording function is not difficult and you can easily figure out how to do it:

Computer-oscilloscope program