MFCC in Python

posted Dec 18, 2019, 1:04 AM by MUHAMMAD MUN`IM AHMAD ZABIDI   [ updated Dec 18, 2019, 1:20 AM ]

Easy with librosa.
The code below gives an array with dim (40,40).

import librosa

sound_clip, s = librosa.load(filename.wav)
mfcc=librosa.feature.mfcc(sound_clip, n_mfcc=40, n_mels=60)

Programming AudioVideo on the Raspberry Pi GPU

posted Nov 26, 2019, 1:30 AM by MUHAMMAD MUN`IM AHMAD ZABIDI   [ updated Nov 26, 2019, 1:31 AM ]

Neither Larman nor Rosenberg

posted Nov 6, 2019, 1:16 AM by MUHAMMAD MUN`IM AHMAD ZABIDI

My understanding of OOAD. Combines the approaches of Rosenberg and Larman.

  1. Rosenberg, D. & Stephens, M.. Use Case Driven Object Modeling with UML: Theory and Practice. Apress. 2007.
  2. Larman, Craig. Applying UML and patterns: an introduction to object oriented analysis and design and interative development. Pearson Education, 2012. link

Python Spectrogram for 1-second Sound

posted Oct 23, 2019, 8:34 PM by MUHAMMAD MUN`IM AHMAD ZABIDI

First install pydub. Use the virtual environment and Anaconda for best results.

$ ls anaconda3/envs
$ source activate sci
$ conda install -c conda-forge pydub

Launch spyder and enter the following code:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-


#import the pyplot and wavfile modules
import matplotlib.pyplot as plot
from import wavfile
from os import path
from pydub import AudioSegment

# Read the wav file (mono)
src = '/home/munim/Downloads/tailorbird1.mp3'
dst = 'tmp.wav'

sound = AudioSegment.from_mp3(src)
sound = sound.set_channels(1)
#onesecond = sound[-1000:] # last one second
onesecond = sound[:1000] # first one second

onesecond.export(dst, format='wav')
samplingFrequency, signalData =

# Plot the signal read from wav file
plot.title('Spectrogram of file {}'.format(src))


Here's the output:


Anaconda desktop entry for Ubuntu 18

posted Oct 19, 2019, 7:47 PM by MUHAMMAD MUN`IM AHMAD ZABIDI

Step 1

Check if anaconda3 is installed on your system or not (Sometime the package may be broken due to network issues during installation (Not worked for me)). And whether you are able to launch anaconda-navigator without a desktop entry. Try this. If it works, you're definitely all set to go.

$ anaconda-navigator &

Step 2

Open your text editor and save the following content as Anaconda.desktop to your home directory.

[Desktop Entry]
Comment=Scientific Python Development Environment - Python3
Exec=bash -c 'export PATH="/home/munim/anaconda3/bin:$PATH" && /home/munim/anaconda3/bin/anaconda-navigator'

Change munim to your username in Exec and Icon lines. Also change python3.7 to something else if you're not on Python 3.7.

Step 3

Copy your Anaconda.desktop to /usr/share/applications/

$ sudo cp Anaconda.desktop /usr/share/applications

This will create a desktop entry named Anaconda in /usr/share/applications/.

Step 4

Hit the Windows key on your keyboard and search for "Anaconda"

From Algorithm to Chip

posted Oct 14, 2019, 10:54 PM by MUHAMMAD MUN`IM AHMAD ZABIDI

Bird Quotations

posted Sep 16, 2019, 8:21 PM by MUHAMMAD MUN`IM AHMAD ZABIDI   [ updated Sep 16, 2019, 8:34 PM ]

”A bird does not sing because it has an answer.
It sings because it has a song.”
Chinese Proverb

”Everyone wants to understand painting.
Why isn’t there any attempt to understand bird songs?”
Pablo Picasso (1881-1973)

”Use what talents you possess: the woods would be very silent if no birds sang there, except those that sang best.”
Henry Van Dyke (18521933)

”Fall is my favorite season in Los Angeles,
watching the birds change color and fall from the trees.”
David Letterman (1947 - )

”God loved the birds and invented trees.
Man loved the birds and invented cages.”
Jacques Deval (1895-1972)

”A light broke in upon my soul –
It was the carol of a bird;
It ceased – and then it came again
The sweetest song ear ever heard.”
Lord Byron (1788-1824)

”It is not only fine feathers that make fine birds.”
Aesop (620 BC - 560 BC)

Feature Engineering: Some Towarddatascience Tutorials

posted Sep 14, 2019, 8:53 PM by MUHAMMAD MUN`IM AHMAD ZABIDI   [ updated Sep 14, 2019, 9:48 PM ]


Six Important Steps to Build a Machine Learning System

A field guide to thinking about ML projects by Rahul Agarwal.

These are the 6 steps:

    1. Problem Definition
    2. Data
    3. Evaluation
    4. Features
    5. Modeling
    6. Experimentation

The Hitchhiker's Guide to Feature Extraction

Some tricks and code for Kaggle and everyday work by Rahul Agarwal.

Two interesting approaches:
  • Automatic feature creation using featuretools framework
  • Using autoencoders

The Five Feature Selection Algorithms every Data Scientist should know

By Rahul Agarwal.

These are the 5 algorithms:

    1. Pearson correlation
    2. Chi-squared
    3. Recursive feature elimination
    4. Lasso from sklearn
    5. RandomForest from sklearn

Overview of LSTM

posted Sep 11, 2019, 2:54 AM by MUHAMMAD MUN`IM AHMAD ZABIDI   [ updated Sep 11, 2019, 2:54 AM ]

1-10 of 137