Acoustic Analysis with Pylab and Scipy

output_7_0

Importing the required packages

import pylab as py

import scipy
from scipy.io.wavfile import read
from scipy.signal import hann
from scipy.fftpack import rfft

Graphing the waveform of a WAV file with Scipy.io and Pylab (Matplotlib)

The files are converted into a numpy array of some sort, bear in mind that scipy is built upon numpy.

source = read('sound.wav')
sr, audio = source
# sr here corresponds to the sample frequency of the file and audio to an array
# of acoustic values
print('Sample Frequency: {:}Hz \nAcoustic Values: {:}'.format(sr, audio))

Sample Frequency:                            44100Hz
Acoustic Values:                                 [ -121 -164 -282 …, -1064 -815 -717]

py.plot(audio, 'k')

py.ylabel('Decibels')
py.xlabel('Duration')
py.title('Vowel Wave Form')
py.xlim(0, 303104)

py.show()
output_5_0
Analysis may also be carried out on specific slices of the sound token as shown below
py.plot(audio[110000:150000], 'k')

py.ylabel('Decibels (dB)')
py.xlabel('Duration')
py.title('A Vowelic Slice')

py.show()

output_6_0

py.plot(audio[180000:190000], 'k')

py.ylabel('Decibels (dB)')
py.xlabel('Duration')
py.title('A Noisy Slice')

py.show()

output_7_0

Basic Fourier Analysis

window = hann(303104)
sample = audio * window

magnitude = 20 * scipy.log10(abs(rfft(sample)))
magnitude -= max(magnitude)

py.plot(magnitude, 'k')
py.ylabel('dB')
py.xlabel('Frequency')
py.title('Uneme Vowel Spectrum')
py.xlim(0, 303104)

py.show()

output_9_0

The Linux Scheduler: a Decade of Wasted Cores

the morning paper

The Linux Scheduler: a Decade of Wasted Cores – Lozi et al. 2016

This is the first in a series of papers from EuroSys 2016. There are three strands here: first of all, there’s some great background into how scheduling works in the Linux kernel; secondly, there’s a story about Software Aging and how changing requirements and maintenance can cause decay; and finally, the authors expose four bugs in Linux scheduling that caused cores to remain idle even when there was pressing work waiting to be scheduled. Hence the paper title, “A Decade of Wasted Cores.”

In our experiments, these performance bugs caused many-fold performance degradation for synchronization-heavy scientific applications, 13% higher latency for kernel make, and a 14-23% decrease in TPC-H throughput for a widely used commercial database.

The evolution of scheduling in Linux

By and large, by the year 2000, operating systems designers considered scheduling to be…

View original post 2,288 more words

Basic Text Analysis with NLTK (Python)

What follows is a presentation of some very basic NLP procedures, with NLTK a NLP package for the Python Programming language, although not the only package available for NLP, it has the advantage of simplicity afforded by the nature for the Python Programming language(Other popular NLP packages include Stanford’s Core NLP, and Apache’s Open NLP, these packages are written in Java.). Amongst the numerous high level programming languages in existence, Python proves to be one of the least complicated, it is very true to the essence of such languages, as languages which are more human readable and portable than Assembler and Machine languages while sacrificing speed.

Preliminaries

In this post I brush over some basic NLP processes including text tokenisation, part of speech tagging as well named entity recognition. Particularly how these can be achieved in the Python Programming language through the Natural Language Toolkit (NLTK) package developed by Steven Bird and his associates.

NLP is broad field spanning Linguistics , Computer Science  and  Engineering, to mention a few. NLP which is used here to mean Natural Language Processing shouldn’t  be confused with Neurolingistic Programming. NLP as we mean it here, is that field concerned with the interaction between machines and human languages, it seeks to make Language accessible to machines and to make human machine interaction much easier.  This field is one which has come a long way, however there remains many NLP problems that are yet to be solved. The ultimate goal of the field may be considered to be true A.I  (i.e a truly intelligent machine possessing  every human cognitive ability, in this case the L.A.D and thus an ability to acquire, use, comprehend and learn Language).

NLP is at work everyday of our modern lives. Everything from search engines, to online translation services such as bing and Google translate, chatbots and text auto completion on our phones are NLP driven.

Basic Text Analysis with NLTK

What follows is a presentation of some very basic NLP procedures, with NLTK a NLP package for the Python Programming language, although not the only package available for NLP, it has the advantage of simplicity afforded by the nature for the Python Programming language(Other popular NLP packages include Stanford’s Core NLP, and Apache’s Open NLP, these packages are written in Java.). Amongst the numerous high level programming languages in existence, Python proves to be one of the least complicated, it is very true to the essence of such languages, as languages which are more human readable and portable than Assembler and Machine languages while sacrificing speed.

Importing the necessary package
A concordance
Basic Text Analysis
The frequency of word endings in a Text

Tokenising Texts

  • Word Tokenisation

  • Sentence Tokenisation

Stemming Tokens 

Part of Speech tagging

Named Entity Recognition

Code Output

LaTeX Programming: Coding Syntactic Trees in LaTeX with Qtree. 

In a previous post, I discussed the LaTeX in general terms, there I made an unsubstantiated claim that it could be of benefit to  the Linguist. In an attempt to substantiate that claim this post came to life. I will try highlight how the the LaTeX programme may be employed to solve the problems Syntactic tree drawing without pencils.

So it is day number 3 for me since I started learning LaTeX /leɪ.tɛk/ or /la.tɛk/, and the programme continues to prove it’s worth. In a previous post, I discussed the LaTeX in general terms, there I made an unsubstantiated claim that it could be of benefit to  the Linguist. In an attempt to substantiate that claim this post came to life. I will try highlight how the the LaTeX programme may be employed to solve the problems Syntactic tree drawing without pencils.

This post will be in the form of the presentation of a set of screen shots of a document created with the VerbTeX application for android devices, which includes some syntactic trees and instructions for their derivation. The raw code is also included.

LaTeX input code first page run on an android device with VerbTeX
LaTeX input code second page run on an android device with VerbTeX
First page of the pdf output
Second page of the pdf output
Page three of the pdf output

Thank you for your time.

9 December: Life after HUGE? Registration now open

Bridging the Unbridgeable

Below, you will find the preliminary programme for the symposium Life after HUGE? which will be held on 9 December at the Leiden University Centre for Linguistics. Registration is now open, and you may do so either by leaving a comment to this message or by sending an email to Ingrid Tieken-Boon van Ostade (i.m.tieken@hum.leidenuniv.nl). There will be no fee for the conference, so we hope to see as many of you as are interested in the topic.

Symposium: Life after HUGE?

Speakers:

Rebecca Gowers, “Another One?”

Why I wanted to write Horrible Words. What I thought I was after. Certain ways in which I know the book failed. Other ways in which I hope it modestly succeeded. How some of the responsibility for all this can be laid at the feet of Ingrid Tieken-Boon van Ostade, her colleagues and various of her PhD students. An undertaking never to…

View original post 753 more words

A Dummies take on LaTeX

So I started learning LaTeX yesterday and I am enjoying it. I feel like a geek, like the next Zuckerburg, but then I remember its just a text generating programme. LaTeX is anot extentsion of Donald Knuth TeX programme by Leslie Lamport

So I started learning LaTeX yesterday and I am enjoying it. I feel like a geek, like the next Zuckerburg, but then I remember its just a text generating programme. LaTeX is an extentsion of Donald Knuth TeX programme by Leslie Lamport.

Texts generation with LaTeX proceedes by the the provision of inputs constituted by: 

▪Commands- They have the format specified below:

\commands[optional parameters]{obligatory parameters} e.good

\section{No love lost}

\documentclass[20pt(fontsize ), executivepaper/a4paper/letterpaper]{article/modercv/beamer/slide}

These specify the structure of the text, they typically do not appear in the output, they are the features which distinguish the LaTeX programme from other word processors like Word. They serve to implement plug-ins and other features which the bare LaTeX programme would lack e.g  Qtree (which can be used to generate syntactic trees)

 ▪Texts- Normal texts shaped by specific commands, they constitute the content of the output. They are nested in between the command line for the beginning and end of the document. E.g. 

‘The Not So Short Introduction to LATEX2″ Or LATEX2″ by Tobias Oetiker Hubert Partl, Irene Hyna and Elisabeth Schlegl’, has so far been an excellent introductory material. Android users can download the LaTeXeditor to run latex on their phones. Texstudio and Texworks e.t.c can be downloaded for Mac,Windows and Linux PC’s. Overleaf runs a Web based Latex Editor.

THE DUMMY HAS SPOKEN.