introduction:
function varargout = mm1(varargin)
% MM1 MATLAB code for mm1.fig
% MM1, by itself, creates a new MM1 or raises the existing
% singleton*.
%
% H = MM1 returns the handle to a new MM1 or the handle to
% the existing singleton*.
%
% MM1('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in MM1.M with the given input arguments.
%
% MM1('Property','Value',...) creates a new MM1 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before mm1_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to mm1_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help mm1
% Last Modified by GUIDE v2.5 16-May-2018 18:49:30
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @mm1_OpeningFcn, ...
'gui_OutputFcn', @mm1_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before mm1 is made visible.
function mm1_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to mm1 (see VARARGIN)
% Choose default command line output for mm1
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes mm1 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = mm1_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in play.
function play_Callback(hObject, eventdata, handles)
Fs1=44100;
fs=Fs1;
T=1/fs;
song = 'HI'
[y,fs] = audioread('Jay.wav',[6500000 7800000]);
sound(y,fs);
time=(1:length(y))/fs;
plot(time, y);
grid("on");
xlabel('time');
ylabel('Magnitude');
title('Original waveform');
% hObject handle to play (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in stop.
function stop_Callback(hObject, eventdata, handles)
clear sound;
% hObject handle to stop (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in up.
function up_Callback(hObject, eventdata, handles)
Fs1=44100;
fs=Fs1;
T=1/fs;
song = 'HI'
[y,fs] = audioread('Jay.wav',[6500000 7800000]);
sound(y,2*fs);
time=(1:length(y))/(2*fs);
plot(time, y);
grid("on");
xlabel('time');
ylabel('Magnitude');
title('Speed up waveform');
% hObject handle to up (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in slow.
function slow_Callback(hObject, eventdata, handles)
Fs1=44100;
fs=Fs1;
T=1/fs;
song = 'HI'
[y,fs] = audioread('Jay.wav',[6500000 7800000]);
sound(y,0.5*fs);
time=(1:length(y))/(0.5*fs);
plot(time, y);
grid("on");
xlabel('time');
ylabel('Magnitude');
title('speed down waveform');
pause(app.music);
% hObject handle to slow (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in Reverse.
function Reverse_Callback(hObject, eventdata, handles)
Fs1=44100;
fs=Fs1;
T=1/fs;
song = 'HI'
[y,fs] = audioread('Jay.wav',[6500000 7800000]);
sound(flipud(y),fs);
time=(1:length(y))/fs;
plot(time, y);
grid("on");
xlabel('time');
ylabel('Magnitude');
title('Reverse waveform');
% hObject handle to Reverse (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in Fourier.
function Fourier_Callback(hObject, eventdata, handles)
fs=44100;
time = 248;
N = fs*time;
f=1/fs;
[y,fs] = audioread('Jay.wav',[6500000 7800000]);
time2=(1:length(y))/fs;
FT=fft(y);
Y = abs(FT/time);
Y2 = Y(1:time/2+1);
Y2(2:end-1) = 2*Y2(2:end-1);
f2 = fs*(0:(time/2))/time;
plot(f2,Y2);
grid("on");
xlabel('Freq');
ylabel('Magnitude');
title('Fourier Transform of y');
% hObject handle to Fourier (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on selection change in speed.
function speed_Callback(hObject, eventdata, handles)
% hObject handle to speed (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns speed contents as cell array
% contents{get(hObject,'Value')} returns selected item from speed
% --- Executes during object creation, after setting all properties.
function speed_CreateFcn(hObject, eventdata, handles)
% hObject handle to speed (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in reset.
function reset_Callback(hObject, eventdata, handles)
% hObject handle to reset (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in loud.
function loud_Callback(hObject, eventdata, handles)
Fs1=44100;
fs=Fs1;
T=1/fs;
song = 'HI'
[y,fs] = audioread('Jay.wav',[6500000 7800000]);
sound(10*y,fs);
time=(1:length(10*y))/fs;
plot(time, y);
grid("on");
xlabel('time');
ylabel('Magnitude');
title('Loud waveform');
% hObject handle to loud (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in slight.
function slight_Callback(hObject, eventdata, handles)
Fs1=44100;
fs=Fs1;
T=1/fs;
song = 'HI'
[y,fs] = audioread('Jay.wav',[6500000 7800000]);
sound(0.1*y,fs);
time=(1:length(0.1*y))/fs;
plot(time, y);
grid("on");
xlabel('time');
ylabel('Magnitude');
title('Slight waveform');
% hObject handle to slight (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)