-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit aa4e5f7
Showing
500 changed files
with
276 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Digital Signal Processing # | ||
|
||
> ELECTENG 733 | ||
> University of Auckland | ||
> Simon Shan | ||
**Emotion recognition** - *Practical Implementation Assignment 2* | ||
May 2020 | ||
|
||
- [x] angry | ||
- [x] excited | ||
- [x] happy | ||
- [x] sad | ||
|
||
### Description ### | ||
|
||
description goes here | ||
|
||
https://www.isca-speech.org/archive/Interspeech_2018/pdfs/1349.pdf | ||
|
||
### Requirements ### | ||
|
||
MATLAB | ||
|
||
run main.m | ||
|
||
## Authors ## | ||
|
||
- **simon** - *<del>buy my merch</del> hire me pls* - [mightbesimon](https://github.com/mightbesimon) | ||
|
||
## License ## | ||
|
||
MIT | ||
|
||
## Acknowledgments ## | ||
|
||
- **these are just my sample codes, if you misuse them its not my problem** | ||
- not actually in ELECTENG 733, just felt like doing the project for fun |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
convert to 20ms frames - load_data.m | ||
|
||
|
||
|
||
data preperation and feature extraction done for all 60 audio signals (together), but traning (i.e. the mle function) is only done on the first 48, classification is done on the last 12 (using the extracted features) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
function [frames] = divide_signal(signal) | ||
|
||
fs = 44100; % value specified in documentation | ||
duration = 0.020; % value specified in documentation | ||
spf = fs * duration; % sameples per frame | ||
|
||
num_frames = fix(numel(signal)/spf); | ||
|
||
frames = reshape(signal(1:num_frames*spf), [num_frames, spf]); | ||
% reshapes the signal from [num_sample x 1] | ||
% to 2D matrix [num_frames x sample_per_frame] | ||
% each row is 1 frame (20ms) | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
%==== FEATURE EXTRACTION ====% | ||
|
||
% short-time energy | ||
ste_male_angry = cellfun(@short_time_energy, audio_male_angry, 'UniformOutput', false); | ||
ste_male_excited = cellfun(@short_time_energy, audio_male_excited, 'UniformOutput', false); | ||
ste_male_happy = cellfun(@short_time_energy, audio_male_happy, 'UniformOutput', false); | ||
ste_male_sad = cellfun(@short_time_energy, audio_male_sad, 'UniformOutput', false); | ||
|
||
% zero-crossing rate | ||
zcr_male_angry = cellfun(@zero_crossing_rate, audio_male_angry, 'UniformOutput', false); | ||
zcr_male_excited = cellfun(@zero_crossing_rate, audio_male_excited, 'UniformOutput', false); | ||
zcr_male_happy = cellfun(@zero_crossing_rate, audio_male_happy, 'UniformOutput', false); | ||
zcr_male_sad = cellfun(@zero_crossing_rate, audio_male_sad, 'UniformOutput', false); | ||
|
||
% pitch | ||
|
||
|
||
% spectral energy | ||
|
||
|
||
% average short-time energy | ||
ave_ste_male_angry = cellfun(@mean, ste_male_angry ); | ||
ave_ste_male_excited = cellfun(@mean, ste_male_excited); | ||
ave_ste_male_happy = cellfun(@mean, ste_male_happy ); | ||
ave_ste_male_sad = cellfun(@mean, ste_male_sad ); | ||
|
||
% average zero-crossing rate | ||
ave_zcr_male_angry = cellfun(@mean, zcr_male_angry ); | ||
ave_zcr_male_excited = cellfun(@mean, zcr_male_excited); | ||
ave_zcr_male_happy = cellfun(@mean, zcr_male_happy ); | ||
ave_zcr_male_sad = cellfun(@mean, zcr_male_sad ); |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
% LOAD AUDIO FILES | ||
% | ||
% read the audio files and | ||
% convert into 20ms frames | ||
|
||
|
||
% define directories | ||
dirAudio = pwd; % dir path to male/female folders | ||
dirMale = fullfile(dirAudio, 'male2'); % male folder | ||
dirFemale = fullfile(dirAudio, 'female1'); % female folder | ||
|
||
|
||
% read audio files | ||
audio_male_angry = read_audio(dirMale, 'angry' ); | ||
audio_male_excited = read_audio(dirMale, 'excited'); | ||
audio_male_happy = read_audio(dirMale, 'happy' ); | ||
audio_male_sad = read_audio(dirMale, 'sad' ); | ||
|
||
% audio_female_angry = read_audio(dirFemale, 'angry' ); | ||
% audio_female_excited = read_audio(dirFemale, 'excited'); | ||
% audio_female_happy = read_audio(dirFemale, 'happy' ); | ||
% audio_female_sad = read_audio(dirFemale, 'sad' ); | ||
|
||
|
||
% convert signals to frames of 20ms | ||
audio_male_angry = cellfun(@divide_signal, audio_male_angry, 'UniformOutput', false); | ||
audio_male_excited = cellfun(@divide_signal, audio_male_excited, 'UniformOutput', false); | ||
audio_male_happy = cellfun(@divide_signal, audio_male_happy, 'UniformOutput', false); | ||
audio_male_sad = cellfun(@divide_signal, audio_male_sad, 'UniformOutput', false); | ||
|
||
% audio_female_angry = cellfun(@divide_signal, audio_female_angry, 'UniformOutput', false); | ||
% audio_female_excited = cellfun(@divide_signal, audio_female_excited, 'UniformOutput', false); | ||
% audio_female_happy = cellfun(@divide_signal, audio_female_happy, 'UniformOutput', false); | ||
% audio_female_sad = cellfun(@divide_signal, audio_female_sad, 'UniformOutput', false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
% ELECTENG 733 | ||
% University of Auckland | ||
% | ||
% Emotion Recognition | ||
% Digital Signal Processing | ||
% Practical Implementation Assignment 2 | ||
% May 2020 | ||
% | ||
% by simon | ||
|
||
|
||
% housekeeping | ||
close all | ||
fclose all | ||
clear; clc | ||
|
||
% constannts | ||
emotions = { | ||
'angry', | ||
'excited', | ||
'happy', | ||
'sad', | ||
} | ||
|
||
|
||
%==== TRAINING STAGE ====% | ||
|
||
load_audio % LOAD AUDIO FILES | ||
% convert into 20ms frames | ||
|
||
extract_features % EXTRACT AUDIO FEATURES | ||
% - short-time energy | ||
% - zero-crossing rate | ||
% - pitch | ||
% - spetral energy | ||
|
||
train_model % TRAIN ESTIMATION MODEL | ||
% maximum likelihood estimation | ||
|
||
|
||
%==== TESTING STAGE ====% | ||
|
||
|
||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.