It give me the error
Can someone please help me? Also please let me know if the for condition is correct. for condition I meant was to execute the command for all the values (idx) 0 to 7
Dear All,
Please advice about this issue.
when i run this line in a script if && || && || && if i enter $x = test3 and $y = test1 the If condition apply while it should not
Best Regards (2 Replies)
I have been using the if statement in csh like this
if ( $opt1 == 1 ) then
.....
elseif ( $opt2 == 1 ) then
......
endif
Seems to work, but got
Badly placed ()'s.
When I used a space in the elseif, a space between the 'else' and the 'if' it worked (0 Replies)
Hi all,
This is my first post in this forum, can i request you to guide, where i am going wrong with the error below.
34: Syntax error: "fi" unexpected (expecting "then")
#!/bin/sh
argCount=0
mysql_path=$USER_INSTALL_DIR$
for i in $*; do
/A argCount+=1
done
if ;then
echo... (2 Replies)
Hi,
Ihave shifted this thread which i posted in linux forum to here if i am fault please correct me.
When i excute this below script i am getting the follwing error can any one please look into it for persual.
./sample_oracle_tradescope.sh: 25: showDEFAULTUsage: not found
... (6 Replies)
Hi,
My requirement is to check wheather some csv files have mandatory columns value as empty if empty log a error message or set a flag.
The problem here is that the column number varies for different CSVs hence we can not hardcode $1 or $3 like this in the awk command hence we are reading a... (5 Replies)
Experts:
LINE1 :This is line one The FIRST line of the file.
LINE2 :This is line two
LINE3 :This is line three with 8 fileds
LINE4 :This is line four
LINE5 :This is line five
LINE6 :This is line six with 8 fileds
I want to delete line 1, and then process the file and want to print lines... (2 Replies)
Hi
I am reading a book about Fortran 90 and I write the following code, to test my understanding of the first chapter. I have a problem with the last section of the code with deals with an IF, ELSEIF, and GOTO statements. Here is my Code
PROGRAM sim
! This code is used to solve two... (3 Replies)
Discussion started by: faizlo
3 Replies
LEARN ABOUT DEBIAN
numm.spectral-analysis
spectral-analysis(7) Numm Tutorials spectral-analysis(7)NAME
spectral analysis - perform realtime spectral analysis
SYNOPSIS
numm-run FILE
DESCRIPTION
Frequency makes for a meaningful description of many audio signals. We can use numpy's fourier analysis to compute spectra from the micro-
phone and display the results visually. We will break down the process into smaller parts: baby steps...
First, create and save a skeletal file that moves a line across the screen:
idx = 0
def video_out(a):
global idx
a[:,idx] = 255
idx = (idx + 1) % a.shape[1]
def audio_in(a):
pass
Save this snippet and run it with numm-run.
We will use the numpy.fft module for our analysis. First we define a function to get a particular frequency from the fourier transform:
import numpy as np
def get_freq(fourier, frequency):
freqs = np.fft.fftfreq(len(fourier), 1/44100.0)
nearest = (abs(freqs - frequency)).argmin()
return abs(fourier[nearest])
Next, we hook up this function to audio input from the microphone. A frequency bin is chosen on a log scale for each row on the screen to
display a spectogram. In total:
import numpy as np
idx = 0
recent_audio = np.zeros(4096, np.int16)
recent_video = np.zeros((240,320,3), np.uint8)
freq_bins = np.exp2(np.linspace(np.log2(27000),np.log2(27),240))
def get_freq(fourier, frequency):
freqs = np.fft.fftfreq(len(fourier), 1/44100.0)
nearest = (abs(freqs - frequency)).argmin()
return abs(fourier[nearest])
def video_out(a):
global idx
fourier=np.fft.fft(recent_audio)
values =np.array([get_freq(fourier,X) for X in freq_bins])
recent_video[:,idx,1] = (values/10000).clip(0,255)
idx = (idx + 1) % a.shape[1]
a[:] = np.roll(recent_video, -idx, axis=1)
def audio_in(a):
recent_audio[:] = np.roll(recent_audio, len(a))
recent_audio[:len(a)] = a.mean(axis=1)
SEE ALSO numm-run(1), numm.getting-started(7), numm.one-bit-instrument(7)numm February 2012 spectral-analysis(7)