xoscope_2.0.3.2 pet soundcard oscilloscope

Mathematical tools, physics simulators, CAD, CNC, etc.
Message
Author
User avatar
mister_electronico
Posts: 969
Joined: Sun 20 Jan 2008, 20:20
Location: Asturias_ España
Contact:

The next to do.

#31 Post by mister_electronico »

Frecuenty.py.gz download the file unzip it and then run for the terminal.

python Frecuenty.gz

You need python installed, this is a very simple program we show the frequency display is entering the microphone.

This can help a lot things that I did not have any method to get the value of the frequency.

I can read data from the serial port integers.
In windows getting read bit by bit RS232 data in Turbo C, this could implement measures of external Tension, but I have not gotten Linux.

I think with this program in a month I may have ready a Pet program.

Could end up before but I am very busy lately working.


See you.


______________________________________________________________________
My blog

https://misterelectronicoes.wordpress.com/
Last edited by mister_electronico on Sun 08 Feb 2015, 18:38, edited 1 time in total.

User avatar
Moose On The Loose
Posts: 965
Joined: Thu 24 Feb 2011, 14:54

Re: Hi Moose On The Loose

#32 Post by Moose On The Loose »

mister_electronico wrote:
A voltage converter Frequency (Hardware) ==> PC microphone ==> Frecuenty.py + Program C ==> gtkdialog for presentation.
The idea is a good one for resolution but not so good for accuracy of calibration..

The good old 555 timer can be made to work as a V to F
The LT6900 or LTC6991 can be made to work as a VCO.
The voltage converter Frequency can be for example a LM131
{/quote]
I think the LM131 may be hard to get.

Or maybe the 4046
The 74HC4046 may be worth a look. You can do some clever (off data sheet) things with them. The R1 and R2 connect internally to current mirror like circuits. We may be able to make the thing calibrated with a bit of cleverness on them to make it compensated for temperature etc.


AD654 is also worth a look. IIRC a 10nF NPO ends up being what sets the accuracy in a good design. The resistors and the device its self generally are better than the best capacitor you can get.

User avatar
mister_electronico
Posts: 969
Joined: Sun 20 Jan 2008, 20:20
Location: Asturias_ España
Contact:

Hi Moose On The Loose

#33 Post by mister_electronico »

Hi Moose On The Loose
The idea is a good one for resolution but not so good for accuracy of calibration..
I'm not too worried about calibration, for this I can adjust by software.

I'll give an example

Suppose we design a circuit that has the ability to measure voltage between 0V and 10V.

And to 0V I assign a frequency of 1000 Hz for microphone input.

10 V And I assign a frequency to 2000Hz frequency input.

But due to the calibration if it is logical that a 5 V give me a frequency of 1500 Hz, but actually gives me 1600 Hz

I would not worry about that software will adjust.


I think AD654 maybe is perfect for this project .


See you.


______________________________________________________________________
My blog

https://misterelectronicoes.wordpress.com/
Last edited by mister_electronico on Sun 08 Feb 2015, 18:38, edited 1 time in total.

User avatar
Moose On The Loose
Posts: 965
Joined: Thu 24 Feb 2011, 14:54

Re: Hi Moose On The Loose

#34 Post by Moose On The Loose »

mister_electronico wrote: I think AD654 maybe is perfect for this project .
This is mostly for others who may be reading along. I figure you have already got there but someone who wishes to copy the idea may be helped by this.

The AD654 turns voltage into frequency making the span of frequencies produced perhaps from 1KHz to 2KHz.

A fairly crude digital filter after the ADC of the sound card can remove the DC AKA the average from the data. This can then be followed by a fairly crude low pass filter to clean up any high frequency noise.

At this point, you have digital values that represent a rounded off squarewave that you wish to know the frequency of. You may be temped to simply count how many times per second the numbers change from negative to positive but you can do way better.

Since simply counting gives you an answer that is give or take one, with a 1KHz signal, you only get a 3 digit number. You can do quite a bit better with this:

Look along the data for the first zero crossing where the numbers go negative to positive. Remember when that happened. Name it T0

Starting at the next crossing count from zero to the one just past one full second later. Call how many crossings N and the time T1.

Note that the time (T1-T0) is not exactly a second but that:

F= N /(T1 - T0)

is a very good measure of the frequency. You get more than 3 digits this way. If you have set the sound card to 16KHz sampling rate, you get just a little better than 4 digits from just doing it in terms of sample number.

You can do a bit better because when the numbers went something like:

-100, -25, 50, 125

You could do a straight line between sample #2 and #3 and estimate when the zero crossing happened between the two samples. This will get you about one more digit.

If this is still not good enough, you can do this:

We are only taking T0 and T1, if we remembered the time of the crossing after T0 and the next one after T1 making T0A, T0B, T1A and T1B we could do:

FA = N / (T1A - T0A)
FB = N / (T1B - T0B)


F = (FA + FB) / 2

This can be extended to average together 100 readings. Those who did a statistics class would expect the average to be sqrt(100)=10 times better. In practice, it tends to come in better than that. The reason has to do with how noise is on a sound card. Down near 1KHz, they are quite good but up near 20KHz where human hearing starts to get bad, they are not as good. Effectively averaging T1A and T1B by the average we take of FA and FB, strongly rejects the effect of the noise at higher frequencies.

User avatar
mister_electronico
Posts: 969
Joined: Sun 20 Jan 2008, 20:20
Location: Asturias_ España
Contact:

Hi Moose On The Loose

#35 Post by mister_electronico »

All this is very well but so far I have no knowledge to program sound card and capture data as you say, the only thing I have is the Frecuenty.py program.

I hope to capture the frequency Frecuenty.py program reasonably well.

And indeed as you say we will have to adapt square wave output of the AD654 to become a sine wave with a good filter.

This week I will do tests as Frecuenty.py program captures the frequencies from a frequency generator.

Like I said I do not care that is not perfect, I can fix that by sotfware.

I'll schedule it in a month I hope to have it finished.

See you.

______________________________________________________________________
My blog

https://misterelectronicoes.wordpress.com/
Last edited by mister_electronico on Sun 08 Feb 2015, 18:39, edited 1 time in total.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#36 Post by greengeek »

Hi mister_electronico, I just used your xopet and it is working well for me using a modified Slacko5.3.3t puppy (I did need to use the extra lib you posted too). This is very interesting. Straight away I was able to display the waveform of my voice through the microphone. I am hoping to be able to use this to display the voltage waveform produced by a small stepper motor which I am using to generate electricity.

The stepper has a series of permanent magnets that rotate inside a group of coils. I guess all I need to do is make an interface to isolate the generated voltage from the audio card input and see what waveform and voltage I have. (EDIT - the waveform will not be high frequency as it is just going to be turning at around 100 - 200 rpm or something like that)

Do you know if xoscope is able to display two separate channels at once? I see it has 8 channels, but all of them seem to be displaying the same signal on my machine - yet I only have one microphone plugged in. (I will have to investigate adding a second soundcard too - probably that is how the extra channels need to operate)

EDIT :OK, now I have looked through the whole topic and got a better idea of how this works.

NOTE TO SELF - build the protection circuit posted by Rodney here

Also note possible interface circuit module described here

Homepage for xoscope here

User avatar
mister_electronico
Posts: 969
Joined: Sun 20 Jan 2008, 20:20
Location: Asturias_ España
Contact:

The reply

#37 Post by mister_electronico »

Hi greengeek is nice to see what xoscope that is useful

Please be careful with microphone inputs that are very sensitive , and if you put a high voltage will produce a breakdown in you sound card .

Follow the recommendations in the post Rodney Byne

http://www.murga-linux.com/puppy/viewto ... 114#765114

Note that the stepper motor or any engine produce large voltage transients that might break your sound card.


With what would be best to put an isolator between the engine and the sound card as an operational buffer as input separator.


Both microphone inputs are available independent you have.

Note that many of those selling microphones have a stereo plug, but the microphone is mono, so that you see the same signal at the two sites.

I think the other channels are reserved for other equipment that you can use as ProbeScope and bitscope, but do not know how these work.

You can place signs at different levels for a closer look inside the toolbar select Channel, then modify the Scale and Position of that channel.

If press the same time the keys Shif+? show you the Help in the window of xoscope.


Ok greengeek good luck with xoscope.

See you.

______________________________________________________________________
My blog

https://misterelectronicoes.wordpress.com/

Post Reply