Code covered by the BSD License  

Highlights from
Mu Law Compander

image thumbnail

Mu Law Compander

by

 

15 Feb 2014 (Updated )

This exercise shows the mu-law input-output characteristic for a range of values of mu from 1 to 500

mu_law_compander_GUI25
function mu_law_compander_GUI25
% Modifiable runGUI file
clc;
clear all;

% USER - ENTER FILENAME
fileName = 'mu_law_compander.mat';    %USER - ENTER FILENAME
fileData=load(fileName);
temp=fileData(1).temp;

f = figure('Visible','on',...
'Units','normalized',...
'Position',[0,0,1,1],...
'MenuBar','none',...
'NumberTitle','off');

%SENSE COMPUTER AND SET FILE DELIMITER
switch(computer)				
    case 'MACI64',		char= '/';
    case 'GLNX86',  char='/';
    case 'PCWIN',	char= '\';
    case 'PCWIN64', char='\';
    case 'GLNXA64', char='/';
end


% find speech files directory by going up one level and down one level
% on the directory chain; as follows:
    dir_cur=pwd; % this is the current Matlab exercise directory path
    s=regexp(dir_cur,char); % find the last '\' for the current directory
    s1=s(length(s)); % find last '\' character; this marks upper level directory
    dir_fin=strcat(dir_cur(1:s1),'speech_files'); % create new directory
    start_path=dir_fin; % save new directory for speech files location

% USER - ENTER PROPER CALLBACK FILE
Callbacks_mu_law_compander_GUI25(f,temp,start_path);    
%panelAndButtonEdit(f, temp);       % Easy access to Edit Mode

% Note comment PanelandBUttonCallbacks(f,temp) if panelAndButtonEdit is to
% be uncommented and used
end

% GUI Lite 2.5 for mu-law companding of speech
% 2 Panels
%   #1 - input parameters
%   #2 - graphics displays
% 4 Graphic Panels
%   #1 - mu-law curves
%   #2 - original speech signal
%   #3 - original speech histogram
%   #4 - mu-law encoded speech histogram
% 1 TitleBox
% 5 Buttons
%   #1 - pushbutton - Speech Directory
%   #2 - popupmenu - Speech Files
%   #3 - editable button - mu: mu-law compression value
%   #4 - pushbutton - Run Mu-Law Compander
%   #5 - pushbutton - Close GUI

Contact us