Signal analysis

Folks with an interest in this subject are likely already aware of Wolfgang Buescher's epic Spectrum Lab software. This works well under Wine, but there is still no sign of a version of Wine for ARM-based machines.

Sox works well on a Raspberry Pi, but its analytical functions are limited: while it generates FFT data for its (limited) graphical spectrograms, this data is not available numerically.

ISTM that the ideal solution would be a native *n*x port of Spectrum Lab, but somehow I can't see Wolf (or anyone else) doing that. Another, less taxing, possibility is to patch Sox to add a hook to make it cough up its FFT data in a nice friendly numerical format (like Spectrum Lab). Alas this may be beyond my programming ability even if I had the time (which I haven't) to swot up on DSP.

The latest Pis should be capable of some useful signal analysis work, but there is a software gap. Does anyone have any thoughts on bridging this?

Reply to
Hils
Loading thread data ...

What's the advantage of using a Pi/2/3/ for the analysis?

Reply to
mm0fmf

As it's likely to be running 24/7, lower capital and running costs over a laptop capable of running Wine and Spectrum Lab.

I may just try tinkering with a Pi and see what it can do with Sox and ImageMagick, but it would be nice to have the analytical versatility offered by Spectrum Lab.

Reply to
Hils

How about using Mathematica, which is after all available gratis and included with Raspbian?

// Christian

Reply to
Christian Brunschen

I though that may be the reason. You could buffer up lots of samples to "disk" then analyse them later on a machine which has the right tools. Not ideal but at least you don't end up running a bigger, thirsty computer 24/7.

Reply to
mm0fmf

Dana Sun, 13 Mar 2016 10:32:30 +0000, Hils napis'o:

Use praat.

Reply to
Nikolaj Lazic

I'm not surprised that Wine isn't available for Raspbian. Here's why.

While Wine is, IIRC, written in C and so should, at least in theory, port fairly easily to an RPi running Raspbian, don't forget that its not an emulator. Wine is best thought of as a service call translator which intercepts Windows service calls, carries out the equivalent operation by making one or more Linux system calls and then returns the results in the same format as the reply expected from the Windows service call.

Since Wine doesn't include an Intel X86 instruction emulator there's no way that a Windows X86 executable can be run on a RaspberryPi without an Intel X86 hardware emulator for Raspbian.

I take it that there's no Spectrum Lab port for anything like an ARM- based MS Surface machines, but even if there was, there's still be considerable work to do unless the binary form of Windows service calls is identical on both X.86 and ARM hardware. This is because Wine would need modification before it could recognise and handle the ARM service calls.

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
 Click to see the full signature
Reply to
Martin Gregorie

Super easy data handling, fantastic analysis tools, very neat graphics. Not suited for live signal analysis on the Pi, though. (Not sure if that was what OP wanted.)

Reply to
A. Dumas

Imagine being able to place affordable digital oscilloscopes into the hands of grade school students. I remember having to help my father build a Heathkit scope, and knowing how to use it was a great benefit to understanding circuits, if only I had been allowed to use it on my own without waiting for my father to permit and set up his expensive bench tool. And what's to prevent using a Pi as a network analyzer? It may not be able to keep up with a fully saturated giabit/sec network, but that would be a tool with which to study classroom/home networks which is readily available at low cost and certainly places such analysis tools within the economic grasp of the masses. Lanier made $10,000+ word processing machines which were dedicated to the purpose. Then IBM introduced the PC, and anyone with $500 could buy the WordPerfect software package - and that revolutionized industries (the legal profession comes to mind.) Nowadays $35 buys a multi-tool which includes virtually hundreds of thousands of dollars in value of available software, and I only need Leafpad to whip up my homework, but if I need fancy, OpenOffice is much more than I need and costs only download and install time from a network connection I can access no charge at my school or a public library.

So, "What's the advantage of using a Pi/0/2/3/ for the analysis?" is now rather obvious... publish your findings and anyone with a Pi has one more tool with which to make the world a better place by understanding our environment and our place in it. Nourish the mind and your lifestyle improves.

--
   All ladders in the Temple of the Forbidden Eye have thirteen steps. 
There are thirteen steps to the gallows, firing squad or any execution. 
 Click to see the full signature
Reply to
DisneyWizard the Fantasmic!

Op Sun, 13 Mar 2016 17:55:27 -0000 (UTC) schreef Martin Gregorie:

This puzzles me. If Wine on a x86 machine can (it will) run a Windows program (which I assume is written in x86 assembler - perhaps by a C compiler or somesuch) it has to know x86 machine language, otherwise how can it know when a Windows call is executed.

Binary forms of x86 and ARM definitely differ.

groet Coos

Reply to
Coos Haak

Wine is built to run on X86 Linux systems, so of course it can recognise Windows X86 service calls because it must to work at all, but it has no need to interpret the other X86 machine code. If it did that it would run a Windows application somewhere between 3-6 times slower than it runs under Windows on the same hardware. However you don't see this slow down (ever run Excel under Wine? I have) so there's a clue that its executing Windows code at full speed in hardware rather than using an emulator and this also implies that its using hardware traps to catch the Windows system calls. Even if this catches ALL interrupt jumps or subroutine calls (I have no idea how Windows system calls are implemented - either would be a sensible mechanism) the overheads of interpreting these trapped instructions if they are recognised as referencing code outside the program that is being executed are way less than using an X.86 emulator to execute every instruction in the Windows program.

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
 Click to see the full signature
Reply to
Martin Gregorie

Op Mon, 14 Mar 2016 00:23:42 -0000 (UTC) schreef Martin Gregorie:

Thanks, (and Wikipedia). Dosemu can run nearly full speed on x86 linux by intercepting the int 21 DOS-interrupt en DOS and BIOS interrupts. But it can not run on ARM. DOSBOX runs on my Raspberry Pi and x86 machines but far slower because of its need to emulate every instruction.

groet Coos

Reply to
Coos Haak

What type of signal? For audio rate (or non-realtime) things like pd, csound or supercollider might work (I've used csound & pd on other systems but pd only a tiny bit on the pi). They tend to be sound generation oriented but do some analysis.

You might gawk a bit at the program list at planet ccrma

formatting link

satellite ccrma is (was?) a project at stanford to interface arduino based sensors to pi sound generation. pidora based (planet ccrma is fedora based)

Interacting a bit non-standard I find the repo at

formatting link

and the file

planetccrma-repo-1.1-3.fc18.ccrma.noarch.rpm

though I suspect it's all on the sd image for satellite ccrma.

basicdsp

formatting link

looks possibly interesting for teaching/learning basics.

And at one time there was something called something like maaate & bewdy. They used to be in freebsd's ports list.

Ron

Reply to
colonel_hack

The point is the x86 processor emulates the x86 processor.

Since no windows program calls direct to the hardware, WINE simply replaces 'windows' libraries with 'wine' libraries.

--
Karl Marx said religion is the opium of the people. 
But Marxism is the crack cocaine.
Reply to
The Natural Philosopher

I have run x86 Linux binaries on a Pi 1 using qemu-user-x86. This emulates x86 instructions on ARM, as well as translating system calls (Linux to Linux in this case, but it has to know about each one to change the ABI). It only runs the binary you asked for, the rest of the system remains ARM.

It...was....slow, veeerrrryyyy sllloooww. I eventually gave up, not because of the slowness, but because my binary was making system calls that qemu didn't know about. I think Linux had acquired some more syscalls since the qemu layer was written, or they didn't implement them all.

While the Pi has got faster since then, it would still wouldn't be pretty. Especially for a signal processing app which actually does some compute (my program was driving a USB widget, so wasn't working very hard)

Theo

Reply to
Theo Markettos

On the other hand, (I have heard that) there are emulators for other older platforms that are actually faster than the platform they are emulating... even in this case: it may run faster than a PC XT...

Reply to
Rob

Well yes, its not hard to beat a 4MHz Z80 or a 2MHz 6502 or 6809 with a GHz x86......

But the ARM is already not as fast as a modern x86.

--
No Apple devices were knowingly used in the preparation of this post.
Reply to
The Natural Philosopher

IIRC the Spectrum Lab author started writing it in Borland C for DOS, and ever since has developed it as win32 as "evolved" and as he has become involved in various experiments and projects. One of its great utilities is monitoring radio signals over long periods (which is one of my interests) but it has other uses too.

He has given us unique and useful software, and I certainly understand if, having come this far with it with DOS and win32, he has no interest in porting it.

As I write, it's chugging away under Wine logging the strengths of signals around 20MHz. It's such a nice tool when properly configured that I may after all look out for a cheap laptop to dedicate as a real-time monitoring system, or to analyse stored audio files. Running GNU/Linux and Wine rather than Win32 will make it a seamless addition to my network.

Regarding points which other folks have made, I'm unlikely to use Mathematica because the code wouldn't be portable unless I bought the version for non-Pi systems. It's possible that Octave can do what I want, though ISTR when I played around with R (which is quite similar) it choked on large WAV files. (That was on a win32 box though.) Praat seems to be oriented towards voice analysis, but I'll take a look at that. (I may even see what it makes of my singing...)

mm0fmf's suggestion of using a Pi as a sound recorder is probably worth a try, that's something which Sox will be able to handle nicely.

I already have a Pi set up to control the frequency and mode of my main receiver, either to a monitoring schedule (using cron jobs) or on command. This Pi can also control a TNC and capture and store decoded messages from it. (I haven't yet tried using the Pi to stream audio from the receiver over wifi, I don't really need it for what I'm doing just now.)

DisneyWizard's suggestion of a Pi-based digital oscilloscope is a good one, such a thing would IMV be more useful than some of the more gimmicky things for which Pis are being used in the name of education. (Are there any university electronic engineering departments with enough test equipment for their students?)

Thanks to all for the comments and suggestions, and the exegesis over Wine and ARM architecture. My apologies for not mentioning everyone by name, no favouritism is intended.

Reply to
Hils

I found it great to see it on the news running on a search vessel where they were looking for pings from the lost MH370's flight data recorder.

One would think that the makers of the flight data recorder would have specified an expensive dedicated device for locating it, but instead the search crew used a laptop running Spectrum Lab.

Of course it wasn't successful, but it was a difficult job. Not so strange that Spectrum Lab was selected for this.

Reply to
Rob

That's a valid consideration. Note that Mathematica Player is free and available on many platforms, so you would only need the full version (free on the Pi) for editing your code.

Reply to
A. Dumas

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.