How to convert .wav to formula? - fft

In scilab I can write like:
t=soundsec(0.5);
s=[sin(2*%pi*440*t)];
savewave('foo.wav', s);
and by this convert formula to .wav.
But how can I convert .wav to formula? If I use
analyze(loadwave('foo.wav'));
I only got graphic? What to do?

Related

I want to convert my .tif files to .asc in R

I have downloaded bioclim variables from worldclim but they are in the Tif format, I want to convert them to ASC format. what would be the code in R for this purpose?

How to convert a string to UTF-16 format in google app script

I am writing a google app script which converts a string to UTF-16 unicode format. For example
Input:Hello World
Output:\u0048\u0065\u006c\u006c\u006f \u0057\u006f\u0072\u006c\u0064
I actually want the script to convert the column containing Arabic words in the goggle doc spreadsheet to UTF-16 format. Like-
Input: مرحبا بالعالم
Output: \u0645\u0631\u062d\u0628\u0627 \u0628\u0627\u0644\u0639\u0627\u0644\u0645
Is there any way I could do this in Google app script ? If yes, please point me to the right direction on ways to doing it.
SO is not the place to have a complete script written for you from scratch but a formula might help you get started:
=TEXTJOIN(,,ArrayFormula(lower("\u0"&DEC2HEX(CODE(SPLIT(regexreplace(A1,"(\D)","$1\"),"\"))))))
The above though recognises a space.
REGEXREPLACE here 'captures' (the ( )) each individual non digit character (the class \D) in A1 and appends to each element of the captured group ($1) a backslash. SPLIT parses the result of REGEXREPLACE at each \. CODE converts the characters into decimal map values which DEC2HEX then converts to signed hexadecimal format for appending to \u0 with the concatenation operator &. LOWER converts the alphabetic elements returned by DEC2HEX as capitals into lower case. SPLIT created an array so ARRAYFORMULA is required for the functions to process all the individual elements (eg DEC2HEX is a non-array function). TEXTJOIN then stitches all the pieces together and is used with defaults for the first two parameters.

convert CSV to JSON using Python

I need to convert a CSV file to JSON file using Python. I used this,
variable = csv.DictReader(file.csv)
It throws this ERROR
csv.Error: line contains NULL byte
I checked the CSV file in Excel, it shows no NULL chars, but when I printed the data in CSV file using Python. There are some data like SOHNULNULHG (here last 2 letters, HG is the data displaying in the Excel). I need to remove these ASCII chars in the CSV file, while converting to JSON. (i.e. I need only HG from the above string)
I just ran into the same issue. I converted my csv file to csv UTF-8 and ran it again without any errors. That seemed to fix the ASCII char issue. Hope that helps.
To convert the csv type, I just opened my file up in Excel, did save as, then selected CSV UTF-8(Comma delimited)(*.csv) in the Save as type.
Hope that helps.

xlsread in octave return zero values

I am trying to read a csv file in octave. The file contains a table with both numeric and text data. It also contains information of date and hour. In addition, the first line is in a different format then the rest of the lines since it contains titles.
The csvread can only read numeric data (according to Octave help), so I tried using xlsread as follows:
[NUMARR, TXTARR, RAWARR, LIMITS] = xlsread ('Line.csv')
I get only a matrix of NUMARR with numeric values. However, all other returned variables are empty- their dimension is 0x0.
How do I get all the text and all other information?
TX!
To solve this issue, open your CSV file in Windows notepad and save it as ANSI format instead of UNICODE.

Convert Excel sheet having shivaji fonts to csv having google unicode utf-8 encoding

I have an Excel file which uses Shivaji fonts and I want to convert it to csv file using google's unicode utf-8 encoding.
I have tried all the methods but I didn't get any result because when saving file as csv it shows ? symbols I need are something like this: à¤Âकटा.
I need to import this file to mysql.
You say "Shivaji font" -- I assume that is for Devanagari characters?
I think what you have has been misconverted twice.
I simulated it by misconverting इंग्लिश to इंगà¥%C2%8Dलिश and then misconverting that to à ¤‡à ¤‚à ¤—à ¥Âà ¤²à ¤¿à ¤¶, which looks a lot like what you have.
When you copied the file around it got converted from utf8 to latin1 twice. Figure out the steps you took in more detail. If you can get a dump at any stage, do so. The hex Devanagari characters looks like E0A4yy where yy is between 80 and B1.