Sponsored Content
Top Forums Shell Programming and Scripting The Start Of A Simple Audio Scope Shell Script... Post 302788835 by wisecracker on Tuesday 2nd of April 2013 02:44:12 PM
Old 04-02-2013
Hi Corona688...

I like the function idea for the config file. Why didn't I think of it...

As for the others, let me get the status lines cleaned up and if need be Trigger/Sync points first... Then I will experiment.

Thanks a lot matey...

Still working out how to get DC in on ONE input only...

I have a simple method of relay switching AC to DC and back using the 1KHz generator but even with the chopper I have no means, AFAIK, whether the DC is +ve or -ve.

This is the idea I have gotten, use the chopper to get the relative DC level, and on exactly the same multivib use the VFO section to detect whether the signal is +ve or -ve, a low freq being -ve and a high freq being +ve... FM and AM in 1 swoop... ;oD

Remember I have only ONE input...

The code should be easy...

BTW, tested on this Macbook Pro OSX 10.7.5 in DEMO and SOX modes and my Gnome Debian 6.0.x in DEMO and DSP modes...
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
HARMINV(1)							      harminv								HARMINV(1)

NAME
harminv - extract mode frequencies from time-series data SYNOPSIS
harminv [OPTION]... [freq-min-freq-max]... DESCRIPTION
harminv is a program designed to solve the problem of "harmonic inversion": given a time series consisting of a sum of sinusoids ("modes"), extract their frequencies and amplitudes. It can also handle the case of exponentially-decaying sinusoids, in which case it extracts their decay rates as well. harminv is often able to achieve much greater accuracy and robustness than Fourier-transform methods, essentially because it assumes a spe- cific form for the input. It uses a low-storage "filter-diagonalization method" (FDM), as described in V. A. Mandelshtam and H. S. Taylor, "Harmonic inversion of time signals," J. Chem. Phys. 107, 6756 (1997). See also erratum, ibid 109, 4128 (1998). INPUT
harminv reads in a sequence of whitespace-separated real or complex numbers from standard input, as well as command-line arguments indicat- ing one or more frequency ranges to search, and outputs the modes that it extracts from the data. (It preferentially finds modes in the frequency range you specify, but may sometimes find additional modes outside of that range.) The data should correspond to equally-spaced time intervals, but there is no constraint on the number of points. Complex numbers in the input should be expressed in the format RE+IMi (no whitespace). Otherwise, whitespace is ignored. Also, comments beginning with "#" and extending to the end of the line are ignored. A typical invocation is something like harminv -t 0.02 1-5 < input.dat which reads a sequence of samples, spaced at 0.02 time intervals (in ms, say, corresponding to 50 kHz), and searches for modes in the fre- quency range 1-5 kHz. (See below on units.) OUTPUT
harminv writes six comma-delimited columns to standard output, one line for each mode: frequency, decay constant, Q, amplitude, phase, and error. Each mode corresponds to a function of the form: amplitude * exp[-i (2 pi frequency t - phase) - decay t] Here, i is sqrt(-1), t is the time (see below for units), and the other parameters in the output columns are: frequency The frequency of the mode. If you don't recognize that from the expression above, you should recall Euler's formula: exp(i x) = cos(x) + i sin(x). Note that for complex data, there is a distinction between positive and negative frequencies. decay constant The exponential decay constant, indicated by decay in the above formula. The inverse of this is often called the "lifetime" of the mode. The "half-life" is ln(2)/decay. Q A conventional, dimensionless expression of the decay lifetime: Q = pi |frequency| / decay. Q, which stands for "quality factor", is the number of periods for the "energy" in the mode (the squared amplitude) to decay by exp(-2 pi). Equivalently, if you look at the power spectrum (|Fourier transform|^2), 1/Q is the fractional width of the peak at half maximum. amplitude The (real, positive) amplitude of the sinusoids. The amplitude (and phase) information generally seems to be less accurate than the frequency and decay constant. phase The phase shift (in radians) of the sinusoids, as given by the formula above. error A crude estimate of the relative error in the (complex) frequency. This is not really an error bar, however, so you should treat it more as a figure of merit (smaller is better) for each mode. SPURIOUS MODES
Typically, harminv will find a number of spurious solutions in addition to the desired solutions, especially if your data are noisy. Such solutions are characterized by large errors, small amplitudes, and/or small Q (large decay rates / broad linewidths). You can omit these from the output by the error/Q/amplitude screening options defined below. By default, modes with error > 0.1 and Q < 10 are automatically omitted, but it is likely that you will need to set stricter limits. UNITS
The frequency (and decay) values, both input and output, are specified in units of 1/time, where the units of time are determined by the sampling interval dt (the time between consecutive inputs). dt is by default 1, unless you specify it with the -t dt option. In other words, pick some units (e.g. ms in the example above) and use them to express the time step. Then, be consistent and use the inverse of those units (e.g. kHz = 1/ms) for frequency. Note that the frequency is the usual 1/period definition; it is not the angular frequency. OPTIONS
-h Display help on the command-line options and usage. -V Print the version number and copyright info for harminv. -v Enable verbose output, printed to standard output as comment lines (starting with a "#" character). Also, any "#" comments in the input are echoed to the output. -T Specify period-ranges instead of frequency-ranges on the command line (in units of time corresponding to those specified by -t). The output is still frequency and not period, however. -w Specify angular frequencies instead of frequencies, and output angular frequency instead of frequency. (Angular frequency is fre- quency multiplied by 2 pi). -n Flip the sign of the frequency (and phase) convention used in harminv. (The sign of the frequency is only important if you have complex-valued input data, in which case the positive and negative frequency amplitudes can differ.) -t dt Specify the sampling interval dt; this determines the units of time used throughout the input and output. Defaults to 1.0. -d d Specify the spectral "density" d to search for modes, where a density of 1 indicates the usual Fourier resolution. That is, the number of basis functions (which sets an upper bound on the number of modes) is given by d times (freq-max - freq-min) times dt times the number of samples in your dataset. A maximum of 300 is used, however, to prevent the matrices from getting too big (you can force a larger number with -f, below). Note that the frequency resolution of the outputs is not limited by the spectral density, and can generally be much greater than the Fourier resolution. The density determines how many modes, at most, to search for, and in some sense is the density with which the bandwidth is initially "searched" for modes. The default density is 0.0, which means that the number of basis functions is determined by -f (which defaults to 100). This often corresponds to a much larger density than the usual Fourier resolution, but the resulting singularities in the system matrices are automatically removed by harminv. -f nf Specify a lower bound nf on the number of spectral basis functions (defaults to 100), setting a lower bound on the number of modes to search for. This option is often a more convenient way to specify the number of basis functions than the -d option, above, which is why it is the default. -f also allows you to employ more than 300 basis functions, but careful: the computation time scales as O(N nf) + O(nf^3), where N is the number of samples, and very large matrices can also have degraded accuracy. -s sort Specify how the outputs are sorted, where sort is one of frequency/error/Q/decay/amplitude. (Only the first character of sort mat- ters.) All sorts are in ascending order. The default is to sort by frequency. -e err Omit any modes with error (see above) greater than err times the largest error among the computed modes. Defaults to no limit. -E err Omit any modes with error (see above) greater than err. Defaults to 0.1. -F Omit any modes with frequencies outside the specified range. (Such modes are not necessarily spurious, however.) -a amp Omit any modes with amplitude (see above) less than amp times the largest amplitude among the computed modes. Defaults to no limit. -A amp Omit any modes with amplitude (see above) less than amp. Defaults to no limit. -Q q Omit any modes with |Q| (see above) less than q. Defaults to 10. BUGS
Send bug reports to S. G. Johnson, stevenj@alum.mit.edu. AUTHORS
Written by Steven G. Johnson. Copyright (c) 2005 by the Massachusetts Institute of Technology. harminv June 4, 2005 HARMINV(1)
All times are GMT -4. The time now is 12:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy