The Start Of A Simple Audio Scope Shell Script...


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting The Start Of A Simple Audio Scope Shell Script...
# 50  
Old 11-09-2014
Again I have not been idle on this as some serious research has had to be done to get this to work with SoundRecorder.exe as an alternate capture source purely for CygWin.

It is SLOW and likely to be buggy but hey, it works on two installs of CygWin, using the deafult bash terminal.

The command to access it is:-

WINSOUND<CR>

It does not show up in the HELP listing yet but IF you try it you USE IT ENTIRELY AT YOUR OWN RISK.

The attached image is a whistle into the internal microphone grabbed using SoundRecorder.exe inside CygWin.

The final capture should be easier as it is for Linux ALSA and basic shell tools exist using the ALSA sound system.

PulseAudio and OSS both have a basic /dev/dsp to use and SOX is still the first choice for sampling.

Enjoy finding simple solutions to often very difficult problems...

Bazza...

EDIT:

Added a second CygWin snapshot from a laptop using an internal mic.

Last edited by wisecracker; 11-11-2014 at 10:17 AM..
# 51  
Old 12-07-2014
We are now at version 0.30.90.
Lots done here:-
1) Calibrated timebase ranges now in 1,2,5 sequence, commands 1mS, 2mS, 5mS, 10mS, 20mS, 50mS and 100mS.
2) Slowest timebase range also added to complement the Fastest one.
3) Lots of code cleanup but not using latest bash techniques, sticking rigidly to backwards compatibility as far as possible.
4) The second build, DC restorer described in the manual and usage to setup display polarity.
5) The final part of the second build to change the DC restorer to Voltage doubler ready for future use.
6) All captures now not hidden anymore.
7) Other minor things I can't remember at the moment...

Enjoy...

EDIT:
The script is now 131697 bytes in size...

Bazza...

Last edited by wisecracker; 12-07-2014 at 04:00 PM.. Reason: See above.
# 52  
Old 12-29-2014
AudioScope.sh version now at 0.31.00...

The vertical amplifier circuit at the end of the script has been modified to suit Corona688's comment about using analogue modems' isolating 600 Ohm 1 : 1 transformers. C2 is AC coupled to the transformer now and the emitter resistor is now connectd to ground.
No other changes have been done. The original circuit can still be used without modification so there is no need to alter it.

There is now a SWEEP generator built in and is used for bandwidth and LF roll-off tests.
It goes from 4KHz down to about 85Hz and back, twice. It is a poor squarewave that has a certain amount of sinewave ringing on it, this a function of 8 bit depth and 8000Hz sampling speed but was easy to implement.

Its prime objective is to quickly see how the waveform differentiates at LF and integrates at HF/MF giving a quick assessment of the total amplifier BW...

The command is SWEEP<CR> to run it...

Only three modes can play it back inside the code:-
afplay for OSX 10.7.5 and above.
aplay for Linux machines using ALSA.
/dev/dsp for CygWin and Linux machnes with OSS and PulseAudio.

It does not autorun inside a separate xterm window but is there to create the files to be run on a separate machine.

The manual has been updated to include this and the file is now 134772 bytes in size... EEK!

Enjoy...
# 53  
Old 01-30-2015
Well I have finally decided on the method for ALTDC on AudioScope.sh.

I had a choice of three methods:-
1) Chopper.
2) VFO.
3) Freq Counter.

In the end I built a unit thst uses a chopper AND VFO, BUT, can be easily addpted to INCLUDE freq counter mode too.

As it stands at the moment the VFO is dormant but the chopper works a real treat. It can be done with just 3 transistors but mine uses 5 because of the VFO section.

Now working on the shell code to access. The command ALTDC does nothing at the moment.

It is used in tandem with the Vertical Amp and HOPEFULLY will be switched in and out as required using the earphone O/P voltage doubler trigger already built and tested. Because there is only one Mic input then the first scan will be AC and the second will be the DC and/or LF component when ALTDC enabled. After much experimentation I hope to get a bandwidth of DC to around 20KHz as flat as is possible within the limits of a(n) MBP 13 inch unit.

DC is already taken care of with Arduino but I am trying to make Arduino secondary as it requires dependencies for it to work.

On first trials this home built unit not only does DC but may even work to 200Hz, this was a surprise to me...

Photos of the ALTDC board will be uploaded soon.

@Don...

Don you are a star!

Just a little snippet from another thread solved my problem as to how to trigger the DC __adaptor__ to get both the AC and DC components into the computer using the sound system only...

This was it:-
sleep 1&

Which means that I can create a command function to switch the DC board in and call it whilst doing, one, 1 second capture for DC mode...

Exact timings are not critical but I do need to __write__ to the soundcard whilst __reading__ from it simultaneously. (Yes this is possible using shell scripting.)

Thanks for that snippet...
# 54  
Old 01-30-2015
What's its current schematic with the VFO and chopper? I'm very curious.
# 55  
Old 01-30-2015
Hi Corona688...

I will have to draw it in text mode so it will take a while to do however just assume a simple multivib and from one of the transistor collectors add this for the chopper...
This is 0 - +0.1V DC. Effectively 10K/Volt, worst case per cycle, for this range...
I am aware of any drawbacks but remember kids have short attention spans so the simpler and quicker to get going the better.
Code:
                               R3 = 1M
    O/P O-----------------*----/\/\/\----+ 
                          |            __|__
                          |            /////
                         === C1 = 1uF
                          |
             R1 = 1K      |
 DC I/P O----/\/\/\----*--*--+
                       |     |
                       \     o C  Q1 = BC549
                       /      \    b
             R2 = 100K \       \|__o----/\/\/\----O Square wave in from approx 2KHz multivib.
                       /       /|      R4 = 22K
                       \     |/_
                       /     o e
                       |     |
   _GND_  O----*-------*-----*--------------------O
             __|__
             /////

# 56  
Old 01-30-2015
1uF looks rather large to me, I wonder if 0.1 would work.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. OS X (Apple)

A simple variable frequency sinewave audio generator.

Hi all... Well I have not been inactive but working out how to make OSX 10.14.x command line audio player have a variable sample rate. This is a back door as afplay does not have a sample rate flag unlike aplay for ALSA, in Linux flavours. This is a DEMO only but a derivative of it will... (2 Replies)
Discussion started by: wisecracker
2 Replies

2. Shell Programming and Scripting

Generate 10000 unique audio file of 2MB each using shell script.

Hi, I want 10000+ unique Audio file of approx 2MB each. How can i generate numerous audio files using shell script. Any tool, command or suggestions are welcome. If i give one audio seed file then can we create numerous unique files with same seed file? Any help is highly appreciable.... (11 Replies)
Discussion started by: sushil.kumar
11 Replies

3. OS X (Apple)

Python script to do simple audio capture...

This site is the first to get this snippet. It will capture an audio recording of any time length within the limits of OSX's QuickTime Player's capablility... A shell script derivative of this will be used as a further capture for CygWin's AudioScope.sh. Thoroughly read ALL the comments in... (0 Replies)
Discussion started by: wisecracker
0 Replies

4. UNIX for Dummies Questions & Answers

unable to start shell script

Hi, Pleasse could someone advise why i'm getting this error below - No such file or directory dev6:$ ls -ltr ReleaseManagement.sh -rwxr-xr-x 1 dev fix 4830 Aug 22 11:13 ReleaseManagement.sh dev6:$ ./ReleaseManagement.sh : No such file or directory dev6:$ thank you (2 Replies)
Discussion started by: venhart
2 Replies

5. Shell Programming and Scripting

The scope of the shell/perl script is to read the input text file. Validate the expiry date of each

The scope of the shell/perl script is to read the input text file. Validate the expiry date of each certificate and send the mail to the user. The user takes action to add the new certificate to the storage file and user owns the responsibility to update the input text file with the new certificate... (5 Replies)
Discussion started by: casmo
5 Replies

6. What is on Your Mind?

Scope of Shell Programming and scripting

Hi all, I want to know what is the scope and job status of shell Programming and scripting. Does it have any attractive jobs? (2 Replies)
Discussion started by: malikshahid85
2 Replies

7. Shell Programming and Scripting

Help with stop/start Shell Script.

Hi All, I would like to develop a shell script for stop & start an application server (1-4) on Solaris box. Here are the user requirements for this task. 1. User will input the option which server they wish to stop. 2. Will clear cache files from specific location. 3. ... (1 Reply)
Discussion started by: venga
1 Replies

8. Shell Programming and Scripting

scope of a Variable inside shell script

hi all, i'm using the following script, Status=1 Function_do () { while read line; do if ; then #echo $line if ; then Status=0 echo " LINKINK ERROR " fi fi done < ldd.log } Function_do (4 Replies)
Discussion started by: vij_krr
4 Replies

9. Shell Programming and Scripting

simple shell - how to get a parameter typed in a shell script

Hi, I am new to unix and using linux 7.2. I would like to create a script that would make it easyer for me to run my java programms. At the moment I have to type java myJavaprogram I am trying to write a script that will allow me to type something like this "myscript myJavaprogram" or maybe... (4 Replies)
Discussion started by: cmitulescu
4 Replies

10. Shell Programming and Scripting

problem with shell variable's scope

Hi, I am stuck while developing a shell sub-routine which checks the log file for "success" or "failure". The subroutine reads the log file and checks for key word "success", if found it set the variable (found=1). It returns success or failure based on this variable. My problem is, I can... (2 Replies)
Discussion started by: cjjoy
2 Replies
Login or Register to Ask a Question