Saturday, 24 December 2016

Gnuplot/C Update

A new version of Gnuplot/C has been uploaded to SourceForge that includes polar plotting capabiliites : https://sourceforge.net/projects/gnuplotc/.

This adds to the existing plot types :
    Line Plot
    XY Plot
    Pole-Zero Plot
    Spectrogram Plot
    Image Plot

Thursday, 22 December 2016

Polar plot in Gnuplot

I was recently playing with microphone array polar diversity responses and did a search for suitable Gnuplot solutions. There are a number that turned up but none of them really matched my requirement so here it is :

set polar
set angle degree
set size ratio 1
set tmargin 3
set bmargin 3
set title "Microphone Polar Diversity Response : Mic Spacing 0.1 (meters)"
set key out vert nobox

set style line 1 lc rgb 'gray80' lt -1
set grid polar ls 1

unset border
unset xtics
unset ytics

f_maxGain=0.                                    # Maximum gain - MUST BE FLOATING POINT
minGain=-80                                     # Minimum gain - MUST BE INTEGER
tickstep = 10                                   # Ticks every 10 dB
numticks = 8                                    # numticks = r / tickstep :: Don't use divide because numticks is used in for loop and doesn't work
f_numticks = 8.                                 # Floating point numticks


set rrange [minGain:0]
set rtics tickstep format '' scale 0

set label '0°' center at first 0, first -minGain*1.05
set label '90°' right at first -minGain*1.05, 0
set label '180°' center at first 0, first minGain*1.05
set label '270°' left at first minGain*1.05, 0

set for [i=.1:numticks] label at first minGain*0.001, first minGain*((i/f_numticks) + 0.007) sprintf("%d dB", minGain+(i*10))
unset raxis

plot "250.dat" u (-$1+90.):($2-f_maxGain) t "250 Hz" w lines lc rgb "magenta", \
      "500.dat" u (-$1+90.):($2-f_maxGain) t "500 Hz" w lines lc rgb "red", \
      "1000.dat" u (-$1+90.):($2-f_maxGain) t "1000 Hz" w lines lc rgb "blue", \
      "2000.dat" u (-$1+90.):($2-f_maxGain) t "2000 Hz" w lines lc rgb "cyan", \
      "4000.dat" u (-$1+90.):($2-f_maxGain) t "4000 Hz" w lines lc rgb "orange"

print "Hit <CR> to continue ..."
pause -1

The data was generated in a C program. The files look like this (i.e. two columns angle and gain) :

# Antenna Beam Pattern
# Angle Gain
-9.00e+01 -1.17e+00
-8.90e+01 -1.17e+00
-8.80e+01 -1.17e+00
.
.

Here is the plot for 100 mm mic spacing :


The gnuplot script allows the min and max gain values to be changed.

Wednesday, 16 November 2016

The Next Round Of The University Of Oxford, UK Digital Signal Processing Courses Take Place In July 2017

As part of the University Of Oxford Summer Engineering Program for Industry, the Digital Signal Processing courses are returning in July 2017.
The courses are presented by experts from industry for Engineers in industry.
Here is a summary of the two courses.

Digital Signal Processing (Theory and Application) - Tuesday 4th to Thursday 6th July 2017

http://www.conted.ox.ac.uk/courses/details.php?id=H600-24
This course provides a good understanding of DSP principles and their implementation and equips the delegate to put the ideas into practice and/or to tackle more advanced aspects of DSP. 'Hands-on' laboratory sessions are interspersed with the lectures to illustrate the taught material and allow you to pursue your own areas of interest in DSP. The hands-on sessions use specially written software running on PCs.

Subjects include :

Theoretical Foundations
Digital Filtering
Fourier Transforms And Frequency Domain Processing
DSP Hardware And Programming
ASIC Implementation
Typical DSP Applications

Digital Signal Processing Implementation (algorithms to optimization) - Friday 7th July 2017

A one-day supplement to the Digital Signal Processing course that takes the theory and translates it into practice.
http://www.conted.ox.ac.uk/courses/details.php?id=H600-25
The course will include a mixed lecture and demonstration format and has been written to be independent of target processor architecture.
The course will show how to take common DSP algorithms and map them onto common processor architectures. It will also give a guide line for how to choose a DSP device, in particular how to choose and use the correct data word length for any application.

Attendee Feedback From Previous Courses :

It was informative, enjoyable and stimulating
Excellent content, very lively thanks to the 2 excellent presenters - Anonymous
A very good introduction to DSP theory
Excellent lecturers! Really useful information and very understandable
Great mix of theory and practice
The lecturers gave a detailed and excellent explanation of the fundamental topics of DSP with real world engineering practice.
This session closes the gap and clears up much confusion between classroom DSP theories and actual DSP implementation.
Very good session, with in-depth discussion on the math and background.

These courses will be held at the University of Oxford, UK

Sunday, 9 October 2016

FIR Filter Design Notes

When designing an FIR filter it is handy to know how many coefficients are required for your desired implementation.

The Kaiser approximation is the algorithm that tells you how many coefficients your filter will need but not what those coefficients are. It is accurate when using an approximation design algorithm such as the Parks-McClellan (Remez exchange) algorithm.

For designing filters with the windowing functions there are no direct equivalents to Kaiser's approximation, it is more that you have to look at the characteristics of your signal requirements and compare them to the capabilities of the windowing functions. Note : filters designed using windowing functions will typically be longer than those designed using Parks-McClellan.

SigLib includes a range of windows based filter design functions. At the present time it does not include a version of the Parks-McClellan algorithm because there are so many already available. I had a customer recently use this : http://www.iowahills.com/Example%20Code/NewParksMcClellan.txt.

I haven't used this myself but I have heard good reports.

Monday, 4 July 2016

Updated Numerix Host Library

The Numerix Host Library is a library of C/C++ functions that can be used to write DSP data to files for debugging, logging and exchange between different applications such as SigLib, Matlab, Octave, Open Office, Libre Office, Excel, Python and others.

It currently supports .bin .csv, ,dat (gnuplot), .sig (SigLib), XMOS .xmt and .wav file formats.

Numerix Host Library can be downloaded from here.


Friday, 3 June 2016

Frequency Domain Convolution And Filtering

Performing convolution and filtering in the frequency domain is a useful method of increasing the performance of these functions by using the fact that convolution in the time domain is equivalent to multiplication in the frequency domain.

The down side is that there is increased end-to-end latency due to the requirement to translate between the time and frequency domains (and back again).

Two common methods of performing this task are the Overlap And Add or the Overlap And Save.

These algorithms are summarized in the following document : http://www.numerix-dsp.com/tutorials/DSP/FrequencyDomainFiltering.pdf


Tuesday, 2 February 2016

The Next Round Of The University Of Oxford, UK Digital Signal Processing Courses Take Place In July 2016

As part of the University Of Oxford Summer Engineering Program for Industry, the Digital Signal Processing courses are returning in July.
The courses are presented by experts from industry for Engineers in industry.
Here is a summary of the two courses.

Digital Signal Processing (Theory and Application) - Tuesday 5th to Thursday 7th July 2016

http://www.conted.ox.ac.uk/courses/details.php?id=H600-24
This course provides a good understanding of DSP principles and their implementation and equips the delegate to put the ideas into practice and/or to tackle more advanced aspects of DSP. 'Hands-on' laboratory sessions are interspersed with the lectures to illustrate the taught material and allow you to pursue your own areas of interest in DSP. The hands-on sessions use specially written software running on PCs.

Subjects include :

Theoretical Foundations
Digital Filtering
Fourier Transforms And Frequency Domain Processing
DSP Hardware And Programming
ASIC Implementation
Typical DSP Applications

Digital Signal Processing Implementation (algorithms to optimization) - Friday 8th July 2016

A one-day supplement to the Digital Signal Processing course that takes the theory and translates it into practice.
http://www.conted.ox.ac.uk/courses/details.php?id=H600-25
The course will include a mixed lecture and demonstration format and has been written to be independent of target processor architecture.
The course will show how to take common DSP algorithms and map them onto common processor architectures. It will also give a guide line for how to choose a DSP device, in particular how to choose and use the correct data word length for any application.

Attendee Feedback From Previous Courses :

It was informative, enjoyable and stimulating
Excellent content, very lively thanks to the 2 excellent presenters - Anonymous
A very good introduction to DSP theory
Excellent lecturers! Really useful information and very understandable
Great mix of theory and practice
The lecturers gave a detailed and excellent explanation of the fundamental topics of DSP with real world engineering practice.
This session closes the gap and clears up much confusion between classroom DSP theories and actual DSP implementation.
Very good session, with in-depth discussion on the math and background.


These courses will be held at the University of Oxford, UK

Sunday, 3 January 2016

VMWare Virtual Machine Notes

I need somewhere to store my notes so this seems to be as good a place as any.



How To Remove Old Ubuntu Kernel Packages
Stolen from my Brother here : https://edwards.sdsu.edu/research/ubuntu-clean-boot-partition/#more-1599

First, figure out which running kernel you have:
uname -r
Do NOT remove that kernel!

Figure out which kernels you have installed
dpkg -l | grep linux-image | grep ii
Then remove them:
apt-get autoremove <package 1> <package 2>

Shrinking Virtual Machines To Use Less Disk Space
In virtual machine :
sudo apt-get -y autoremove
sudo apt-get clean
cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill

Download vdiskmanager-windows from here :
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1023856
On the host :
vmware-vdiskmanager -k Ubuntu.vmdk