how create app design by MATLAB to read file(wav file),plot signal as audacity, calculate fft (spectrum) and plot fft?
I should use the code attached below, but I don’t know how and where to put it in the code view:
clear
clc
close all
% To read wav-file:
[file,path]=uigetfile({‘*.wav;*.mp3’ ‘Recorded Sound Files’;’*.wav’ ‘wave-file’; ‘*.mp3’ ‘MP3-file’},’Select a file’);
filename=[path file]; % This joins the folder name and file name in one variable
[sgnl,Fs]=audioread(filename); % reads data from filename, and returns sampled data y, and a sampling frequency for that data Fs.
figure
plot(sgnl(:,1)) % to plot the signal [there are 2 column because there are 2 channels on Laptop]
sound(sgnl(:,1),Fs) % to play the sound signal
% to create time steps using the recorded signal and Fs
N = size(sgnl,1); % Assuming Column Vectors
t = linspace(0, N, N)/Fs; % Time Vector
figure
plot(t,sgnl)
xlabel(‘time [sec]’)
ylabel(‘Amplitude’)I should use the code attached below, but I don’t know how and where to put it in the code view:
clear
clc
close all
% To read wav-file:
[file,path]=uigetfile({‘*.wav;*.mp3’ ‘Recorded Sound Files’;’*.wav’ ‘wave-file’; ‘*.mp3’ ‘MP3-file’},’Select a file’);
filename=[path file]; % This joins the folder name and file name in one variable
[sgnl,Fs]=audioread(filename); % reads data from filename, and returns sampled data y, and a sampling frequency for that data Fs.
figure
plot(sgnl(:,1)) % to plot the signal [there are 2 column because there are 2 channels on Laptop]
sound(sgnl(:,1),Fs) % to play the sound signal
% to create time steps using the recorded signal and Fs
N = size(sgnl,1); % Assuming Column Vectors
t = linspace(0, N, N)/Fs; % Time Vector
figure
plot(t,sgnl)
xlabel(‘time [sec]’)
ylabel(‘Amplitude’) I should use the code attached below, but I don’t know how and where to put it in the code view:
clear
clc
close all
% To read wav-file:
[file,path]=uigetfile({‘*.wav;*.mp3’ ‘Recorded Sound Files’;’*.wav’ ‘wave-file’; ‘*.mp3’ ‘MP3-file’},’Select a file’);
filename=[path file]; % This joins the folder name and file name in one variable
[sgnl,Fs]=audioread(filename); % reads data from filename, and returns sampled data y, and a sampling frequency for that data Fs.
figure
plot(sgnl(:,1)) % to plot the signal [there are 2 column because there are 2 channels on Laptop]
sound(sgnl(:,1),Fs) % to play the sound signal
% to create time steps using the recorded signal and Fs
N = size(sgnl,1); % Assuming Column Vectors
t = linspace(0, N, N)/Fs; % Time Vector
figure
plot(t,sgnl)
xlabel(‘time [sec]’)
ylabel(‘Amplitude’) app design, mapping of noise pollution, plot, fft, read file(wav file), plot signal as audacity MATLAB Answers — New Questions