This MATLAB code analyzes two audio signals (.wav files) by:
1. Reading in the signals and extracting the right channel of each stereo recording.
2. Cutting the signals to the same length for comparison.
3. Calculating the fast Fourier transform (FFT) and plotting the power spectra of the cut signals.
4. Comparing the signals by calculating the mean squared error (MSE) and determining if they are the same or not based on a threshold.
Continuous and Discrete Elementary signals,continuous and discrete unit step signals,Exponential and Ramp signals,continuous and discrete convolution time signal,Adding and subtracting two given signals,uniform random numbers between (0, 1).,random binary wave,random binary wave,robability density functions. Find mean and variance for the above
distributions
Continuous and Discrete Elementary signals,continuous and discrete unit step signals,Exponential and Ramp signals,continuous and discrete convolution time signal,Adding and subtracting two given signals,uniform random numbers between (0, 1).,random binary wave,random binary wave,robability density functions. Find mean and variance for the above
distributions
Advanced MATLAB Tutorial for Engineers & ScientistsRay Phan
This is a more advanced tutorial in the MATLAB programming environment for upper level undergraduate engineers and scientists at Ryerson University. The first half of the tutorial covers a quick review of MATLAB, which includes how to create vectors, matrices, how to plot graphs, and other useful syntax. The next part covers how to create cell arrays, logical operators, using the find command, creating Transfer Functions, finding the impulse and step response, finding roots of equations, and a few other useful tips. The last part covers more advanced concepts such as analytically calculating derivatives and integrals, polynomial regression, calculating the area under a curve, numerical solutions to differential equations, and sorting arrays.
MATLAB Programs For Beginners. | Abhi SharmaAbee Sharma
This is MATLAB's 10 most easy & most basic programs that I's supposed to submit in my practicals. In this document I've complied 10 MATLAB programs from basic to advanced through intermediate levels, But overall they are for beginners only. It's only a 26 pages doc. for academic purposes. well, What else a student can offer you, huh? LOLz
Question I Part (a) 1.SOURCE CODE LISTING for numb.docxcatheryncouper
Question I
Part (a)
1.SOURCE CODE LISTING for numbers 0 - 9:
In this program we are going to load the .wav files into MATLAB code and we can be able to play the required key tones from 0 to 9 by
executing the code and listen through the system output devices.
In order to execute the program, the .wav files must be present in the current directory in order to load or play the dial tones.
The time domain plot for the required key tone (including two frequency components) will be observed where the axis will be time on x axis &
Amplitude on Y axis.
Later the frequency Domain plot (indicating the dual frequencies) will be observed using fourier transform
of the time domain of the key tones and with the sampling rate of 8000 Hz .
In this plot the Dual tone Multiple Frequencies is observed in the plot (DTMF Concept) as each keytone is comprised of two frequency
components, one low frequency & one high frequency components. i.e. the Dual frequencies can be viewed separately in the plot for each
number from 0 - 9.
%% Program
% To enter the number manually and listen the tone.
function program_aa
fprintf('Type 1 = Auto Play \n');
fprintf('Type 2 = Manual Play\n');
Type = input('\n enter the type of Input : Type = ');
%% Automatic Input Type
if Type == 1
% loading the .wav files
dial0= 'dial0.wav';
dial1= 'dial1.wav';
dial2= 'dial2.wav';
dial3= 'dial3.wav';
dial4= 'dial4.wav';
dial5= 'dial5.wav';
dial6= 'dial6.wav';
dial7= 'dial7.wav';
dial8= 'dial8.wav';
dial9= 'dial9.wav';
% reading the loaded .wav files
keypad_0 = wavread(dial0);
keypad_1 = wavread(dial1);
keypad_2 = wavread(dial2);
keypad_3 = wavread(dial3);
keypad_4 = wavread(dial4);
keypad_5 = wavread(dial5);
keypad_6 = wavread(dial6);
keypad_7 = wavread(dial7);
keypad_8 = wavread(dial8);
keypad_9 = wavread(dial9);
% playing the .wav files using output sources
wavplay(keypad_0)
wavplay(keypad_1)
wavplay(keypad_2)
wavplay(keypad_3)
wavplay(keypad_4)
wavplay(keypad_5)
wavplay(keypad_6)
wavplay(keypad_7)
wavplay(keypad_8)
wavplay(keypad_9)
end
%% Manual Input Type
if Type == 2
N = input('enter the number of keypad : N = ');
fprintf('\n The Number Entered = %g\n',N);
Fs = 8000; % Sampling Rate is 8 kHz
%% To load and Play for number 0
if N == 0
dial0= 'dial0.wav';
keypad_0 = wavread(dial0);
wavplay(keypad_0,Fs)
% Fourier Transformation
FFT = 2^nextpow2(length(keypad_0)); % Next power of 2 from length of y
Y = fft(keypad_0,FFT)/length(keypad_0);
f = 8000/2*linspace(0,1,FFT/2);
y = 2*abs(Y(1:FFT/2));
fprintf('\n The Low frequency component in Hz = %g\n',941);
fprintf('\n The High frequency component in Hz = %g\n',1336);
fprintf('\n The Fourier transform Max value = %g\n',norm(y));
% Plot Fourier Transform magnitude spectrum.(Frequency Domain)
subplot (2,1,1)
plot(f,y) ;
...
Fast Fourier Transform (FFT) of Time Series in Kafka StreamsHostedbyConfluent
"Digital Signal Processing powered by Kafka streams can open IoT to a new era of possibilities by bringing computational power closer to the location where the data originated.
The purpose of this presentation is to demonstrate the power of Kafka Streams as a backbone for mathematical methods of signal processing. In this session, we’ll explore transforming signals from the time domain to the frequency domain using FFT, maximizing the level of compression of input signals while building a precise frequency alert system.
This presentation focuses on the following areas:
-Signal imitators of periodic waveforms (sine, triangle, square, sawtooth, etc.) in compliance with OpenMetrics standard.
-Pipeline of logical operators (AND, OR, XOR, etc.) that simulate joined superposition of various signal inputs.
-The processor that performs FFT, converting input signals into individual spectral components and thereby provides frequency information about the signal.
-Prometheus/Grafana visualization of FFT of input signals in real time.
By the end of the session, you’ll understand the fundamentals of digital signal processing using Kafka and have the tools you need to build and implement FFT in Kafka Streams."
MATLAB is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages
Implementation of adaptive stft algorithm for lfm signalseSAT Journals
Abstract
Normally Time-Frequency analysis is done by sliding a window through the time domain data and computing the Fourier
Transform of the data within the window. The choice of the window length determines whether specular or resonant information
will be emphasized. A narrow window will isolate specular reflections but will not be wide enough to accommodate the slowly
varying global resonances; a wide window cannot temporally separate resonance and specular information. So we will adapt
window length according to changes in frequencies. In this case we are realizing the specifications of Linear Frequency
Modulation (LFM) signal.
Index Terms—LFM, FFT, DFT, STFT and ASTFT.
MatlabHomeworkHelp.com, the trustworthy platform designed exclusively to assist students in their Matlab assignments. We understand the challenges faced by students and offer reliable solutions to excel in their academic journey. Rest assured, we are not a scam website. With a dedicated team of experienced Matlab experts, we provide comprehensive and personalized assistance to students worldwide. Our success is reflected in the testimonials and reviews from satisfied students who have benefited from our services. Whether you need help with coding, debugging, or conceptual understanding, MatlabHomeworkHelp is your one-stop solution. Trust us for reliable and efficient Matlab homework help.
Email: support@matlabhomeworkhelp.com
WhatsApp: +1 (254) 4015-979
Similar to Matlab code for comparing two microphone files (20)
Study of the release of heat by targeted gold nanoparticles exposed to RF fields. Study the physical properties of gold nanoparticles influence their RF thermal delivery which will aid in the further development of nanoscale materials for the treatment of cancer and various biomedical applications
Courier management system project report.pdfKamal Acharya
It is now-a-days very important for the people to send or receive articles like imported furniture, electronic items, gifts, business goods and the like. People depend vastly on different transport systems which mostly use the manual way of receiving and delivering the articles. There is no way to track the articles till they are received and there is no way to let the customer know what happened in transit, once he booked some articles. In such a situation, we need a system which completely computerizes the cargo activities including time to time tracking of the articles sent. This need is fulfilled by Courier Management System software which is online software for the cargo management people that enables them to receive the goods from a source and send them to a required destination and track their status from time to time.
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
Explore the innovative world of trenchless pipe repair with our comprehensive guide, "The Benefits and Techniques of Trenchless Pipe Repair." This document delves into the modern methods of repairing underground pipes without the need for extensive excavation, highlighting the numerous advantages and the latest techniques used in the industry.
Learn about the cost savings, reduced environmental impact, and minimal disruption associated with trenchless technology. Discover detailed explanations of popular techniques such as pipe bursting, cured-in-place pipe (CIPP) lining, and directional drilling. Understand how these methods can be applied to various types of infrastructure, from residential plumbing to large-scale municipal systems.
Ideal for homeowners, contractors, engineers, and anyone interested in modern plumbing solutions, this guide provides valuable insights into why trenchless pipe repair is becoming the preferred choice for pipe rehabilitation. Stay informed about the latest advancements and best practices in the field.
Water scarcity is the lack of fresh water resources to meet the standard water demand. There are two type of water scarcity. One is physical. The other is economic water scarcity.
Student information management system project report ii.pdfKamal Acharya
Our project explains about the student management. This project mainly explains the various actions related to student details. This project shows some ease in adding, editing and deleting the student details. It also provides a less time consuming process for viewing, adding, editing and deleting the marks of the students.
Immunizing Image Classifiers Against Localized Adversary Attacksgerogepatton
This paper addresses the vulnerability of deep learning models, particularly convolutional neural networks
(CNN)s, to adversarial attacks and presents a proactive training technique designed to counter them. We
introduce a novel volumization algorithm, which transforms 2D images into 3D volumetric representations.
When combined with 3D convolution and deep curriculum learning optimization (CLO), itsignificantly improves
the immunity of models against localized universal attacks by up to 40%. We evaluate our proposed approach
using contemporary CNN architectures and the modified Canadian Institute for Advanced Research (CIFAR-10
and CIFAR-100) and ImageNet Large Scale Visual Recognition Challenge (ILSVRC12) datasets, showcasing
accuracy improvements over previous techniques. The results indicate that the combination of the volumetric
input and curriculum learning holds significant promise for mitigating adversarial attacks without necessitating
adversary training.
Forklift Classes Overview by Intella PartsIntella Parts
Discover the different forklift classes and their specific applications. Learn how to choose the right forklift for your needs to ensure safety, efficiency, and compliance in your operations.
For more technical information, visit our website https://intellaparts.com
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...Amil Baba Dawood bangali
Contact with Dawood Bhai Just call on +92322-6382012 and we'll help you. We'll solve all your problems within 12 to 24 hours and with 101% guarantee and with astrology systematic. If you want to take any personal or professional advice then also you can call us on +92322-6382012 , ONLINE LOVE PROBLEM & Other all types of Daily Life Problem's.Then CALL or WHATSAPP us on +92322-6382012 and Get all these problems solutions here by Amil Baba DAWOOD BANGALI
#vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore#blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #blackmagicforlove #blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #Amilbabainuk #amilbabainspain #amilbabaindubai #Amilbabainnorway #amilbabainkrachi #amilbabainlahore #amilbabaingujranwalan #amilbabainislamabad
Cosmetic shop management system project report.pdfKamal Acharya
Buying new cosmetic products is difficult. It can even be scary for those who have sensitive skin and are prone to skin trouble. The information needed to alleviate this problem is on the back of each product, but it's thought to interpret those ingredient lists unless you have a background in chemistry.
Instead of buying and hoping for the best, we can use data science to help us predict which products may be good fits for us. It includes various function programs to do the above mentioned tasks.
Data file handling has been effectively used in the program.
The automated cosmetic shop management system should deal with the automation of general workflow and administration process of the shop. The main processes of the system focus on customer's request where the system is able to search the most appropriate products and deliver it to the customers. It should help the employees to quickly identify the list of cosmetic product that have reached the minimum quantity and also keep a track of expired date for each cosmetic product. It should help the employees to find the rack number in which the product is placed.It is also Faster and more efficient way.
Democratizing Fuzzing at Scale by Abhishek Aryaabh.arya
Presented at NUS: Fuzzing and Software Security Summer School 2024
This keynote talks about the democratization of fuzzing at scale, highlighting the collaboration between open source communities, academia, and industry to advance the field of fuzzing. It delves into the history of fuzzing, the development of scalable fuzzing platforms, and the empowerment of community-driven research. The talk will further discuss recent advancements leveraging AI/ML and offer insights into the future evolution of the fuzzing landscape.
1. Contents
Matlab Code:
signal into left and right, stereo records
time for right signal only (stereo) for original signals
find new length
find new time
find new frequency
perform fft and plot of the cut orignal signal
Zoom in to signal baseline noise signal
plot two signals
plot fft compare
calculate and compare two signals
corlation
Matlab Code:
Author: Minh Anh Nguyen (minhanhnguyen@q.com) This script will perform the following
tasks:
%1. read in two "wav" files, plot the signals of these files
%2. fft
% 3. compare input signals, and display a message on the screen whether or
not the signals are the same.
% the MSE must be 0, for both signals are the same.
% The script will read in a stereo data (right channel)
close all;% Close all figures (except those of imtool.)
clear all; % Erase all existing variables.
clc;% Clear the command window.
fontSize = 20;
fontSize1 = 14;
fontSize2 = 12;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Please edit files
% set folder
folder = 'C:UsersMinh anhDesktopmicrophone-project-demo';
%%Open WAV file:
sound1=audioread('.good 2.wav');
[y1,fs1]=audioread('.good 2.wav');
sound2=audioread('.good 3.wav');
[y2,fs2]=audioread('.good 3.wav');
% sound2=audioread('.upper_channel 2.wav');
% [y2,fs2]=audioread('.upper_channel 2.wav');
% sound2=audioread('.upper_channel_bide 1.wav');
% [y2,fs2]=audioread('.upper_channel_bide 1.wav');
2. % sound2=audioread('.lower_channel 1.wav');
% [y2,fs2]=audioread('.lower_channel 1.wav');
% sound2=audioread('.pin1.wav');
% [y2,fs2]=audioread('.pin1.wav');
sound1_baseline_noise=audioread('.good 2_noise.wav');
[y1_basenoise,fs1_basenoise]=audioread('.good 2_noise.wav');
%
sound2_baseline_noise=audioread('.good 3_noise.wav');
[y2_basenoise,fs2_basenoise]=audioread('.good 3_noise.wav');
% sound2_baseline_noise=audioread('upper_channel 2_noise.wav');
% [y2_basenoise,fs2_basenoise]=audioread('.upper_channel 2_noise.wav');
% sound2_baseline_noise=audioread('upper_channel_bide 1_noise.wav');
% [y2_basenoise,fs2_basenoise]=audioread('.upper_channel_bide 1_noise.wav');
% sound2_baseline_noise=audioread('lower_channel 1_noise.wav');
% [y2_basenoise,fs2_basenoise]=audioread('.lower_channel 1_noise.wav');
% sound2_baseline_noise=audioread('.pin1_noise.wav');
% [y2_basenoise,fs2_basenoise]=audioread('.pin1_noise.wav');
signal into left and right, stereo records
size(y1);
left1=y1(:,1);
right1=y1(:,2);
[MR1,NR1] = size(right1);
size(y2);
left2=y2(:,1);
right2=y2(:,2);
[MR2,NR2] = size(right2);
time for right signal only (stereo) for original signals
Nl = length(right1); % number of points to analyze
lsl = size (right1); % find the length of the data per second
nbits = 2^(length(right1));
t1l = (0:1:length(right1)-1)/fs1;
fx = fs1*(0:Nl/2-1)/Nl; %Prepare freq data for plot
T1 = 1/fs1; % period between each sample
N = Nl;
N2 = length(right2);
ls2 = size (right2); % find the length of the data per second
nbits2 = 2^(length(right2));
t2 = (0:1:length(right2)-1)/fs2;
fx2 = fs2*(0:N2/2-1)/N2; %Prepare freq data for plot
T2 = 1/fs2; % period between each sample
% baseline noise is removed from signals
3. size(y1_basenoise);
left1_basenoise=y1_basenoise(:,1);
right1_basenoise=y1_basenoise(:,2);
[MR1_basenoise,NR1_basenoise] = size(right1_basenoise);
size(y2_basenoise);
left2_basenoise=y2_basenoise(:,1);
right2_basenoise=y2_basenoise(:,2);
[MR2_basenoise,NR2_basenoise] = size(right2_basenoise);
t1_basenoise = (0:1:length(right1_basenoise)-1)/fs1_basenoise;
t2_basenoise = (0:1:length(right2_basenoise)-1)/fs2_basenoise;
%%cut signal to the same length for comparing
voice1 = right1(fs1*1 : fs1*40);
voice2 = right2(fs2*1 : fs2*40);
find new length
N2x = length(voice2);
N1x = length(voice1);
find new time
t1x = (0:1:length(voice1)-1)/fs1;
t2x = (0:1:length(voice2)-1)/fs2;
find new frequency
f2x = fs2*(0:N2x/2-1)/N2x;
f1x = fs1*(0:N1x/2-1)/N1x;
perform fft and plot of the cut orignal signal
NFFT1x = 2 ^ nextpow2(N1x);
Y1x = fft(voice1, NFFT1x)/ N1x;
f1xx = (fs1/ 2 * linspace(0, 1, NFFT1x / 2+1))'; % Vector containing
frequencies in Hz
STFFT1x = ( 2 * abs(Y1x(1: NFFT1x / 2+1))); % Vector containing corresponding
amplitudes
NFFT2x = 2 ^ nextpow2(N2x);
Y2x = fft(voice2, NFFT2x) / N2x;
f2xx = (fs2 / 2 * linspace(0, 1, NFFT2x / 2+1))'; % Vector containing
frequencies in Hz
STFFT2x = ( 2 * abs(Y2x(1: NFFT2x / 2+1))); % Vector containing corresponding
amplitudes
% plot of the cut orginal signal
figure; subplot (2,2,1); plot(t1x, voice1);xlim([0,40]); ylim([-2,2]);
%str1=sprintf('Correct loading with sampling rate = %d Hz, number sample =
%d', fs1, N1x);
6. Zoom in to signal baseline noise signal
figure; subplot(3,2,1); plot(t1_basenoise,right1_basenoise); xlim([0,10]);
ylim([-2,2]);
str1=sprintf('Correct loading with Zoom in');
title(str1,'Fontsize', fontSize1);
xlabel('Time (secs)','Fontsize', fontSize1); ylabel('Amplitude','Fontsize',
fontSize1); grid on;
subplot(3,2,3); plot(t2_basenoise,right2_basenoise,'r'); xlim([0,10]);
ylim([-2,2]);
str2=sprintf('User loading with Zoom in');
title(str2, 'Fontsize', fontSize1);
xlabel('Time (secs)','Fontsize', fontSize1); ylabel('Amplitude','Fontsize',
fontSize1); grid on;
7. plot two signals
figure, plot(t1_basenoise,right1_basenoise,
t2_basenoise,right2_basenoise,'r'); xlim([0,10]); ylim([-2,2]);
str2=sprintf('Comparing two loading signals with Zoom in ');
title(str2, 'Fontsize', fontSize1);
xlabel('Time (secs)','Fontsize', fontSize1); ylabel('Amplitude','Fontsize',
fontSize1); grid on;
legend ('Correct loading signal', 'User loading signal', 'Fontsize',
fontSize);
Warning: Using an integer to specify the legend location is not supported.
Specify the legend location with respect to the axes using the 'Location'
parameter.
Warning: Ignoring extra legend entries.
8. plot fft compare
figure, plot(f1xx, STFFT1x,f2xx, STFFT2x,'r'); xlim([0,1500]); ylim([0,.09]);
str1ft3=sprintf('Comparing FFT for two loading signals');
title(str1ft3,'Fontsize', fontSize1);
ylabel ('Magnitude', 'Fontsize', fontSize1); xlabel ('Frequency
[Hz]','Fontsize', fontSize1); grid on;
indexmax3 = find(max(STFFT2x) == STFFT2x);
xmax3 = f2xx(indexmax3);
ymax3 = STFFT2x(indexmax3);
strmax3 = ['Frequency = ',num2str(xmax3),' Hz',' ','Magnitude= ',
num2str(ymax3),' '];
legend ('Correct loading signal', 'User loading signal','Fontsize',
fontSize);
Warning: Using an integer to specify the legend location is not supported.
Specify the legend location with respect to the axes using the 'Location'
parameter.
Warning: Ignoring extra legend entries.
9. calculate and compare two signals
Calculate the MSE
D= voice1 - voice2;
MSE=mean(D.^2);
%msgbox(strcat('MSE value is= ',mat2str(),' MSE'));
%msgbox(strcat('MSE value is= ',mat2str(MSE)));
%if MSE ==0;
%if MSE <= 0.00135; %%v this will work
if MSE <= 5.2731e-09 ; %%v this will work
disp('Signal are the same');
else
% msgbox(strcat('MSE value is= ',mat2str(MSE)));
disp('Signal are not the same');
msgbox('Centrifuge loading error. Please check bearings are seated
properly');
end
% %% play back play back the audio files
% disp('Playing (correctly loaded).');
% sound(y1,fs1);
% pause; %create a 2 second pause
%
%
10. % disp('Playing the user loading.');
% sound(y2,fs2);
% pause
%%Calculate variance, mean and standard deviation of sounds
D1c= STFFT1x - STFFT2x;
MSEfft=mean(D1c.^2);
disp(['MSEfft' num2str(MSEfft)]);
mean1= sum(right1)/N;
mean2= sum(right2)/N2;
stdev1 = sqrt ((sum(right1-mean1).^2)/2);
stdev2 = sqrt ((sum(right2-mean2).^2)/2);
% var(right1(1:length(right2))-right2) %for the whole signal y1-y2
var(voice1(1:length(voice2))-voice2); %for the voice
fprintf('digital statitics of voice 1 a same length signalnn');
fprintf('mean of voice 1:%fn', mean(voice1));
fprintf('standard deviation of voice 1:%fn', std(voice1));
fprintf('variance of voice 1:%fn', std(voice1)^2);
fprintf('average power of voice 1:%fn', mean(voice1.^2));
fprintf('average magnitude of voice 1:%fn', mean(abs(voice1)));
% prod1 = sound1(1:N-1) * sound1(2:N);
% crossing1 = length (find(prod1<0));
% fprintf(' zero crossing of sound 1:% 0.fn', crossing1);
%
fprintf('ndigital statitics of voice 2nn');
fprintf('mean of voice 2:%fn', mean(voice2));
fprintf('standard deviation of voice 2:%fn', std(voice2));
fprintf('variance of voice 2:%fn', std(voice2)^2);
fprintf('average power of voice 2:%fn', mean(voice2.^2));
fprintf('average magnitude of voice 2:%fn', mean(abs(voice2)));
% prod1 = sound1(1:N-1) * sound1(2:N);
% crossing1 = length (find(prod1<0));
% fprintf(' zero crossing of sound 1:% 0.fn', crossing1);
%
% % var(right1(1:length(right2))-right2) %for the whole signal y1-y2
% var(voice1(1:length(voice2))-voice2); %for the voice
%
%
Signal are the same
MSEfft0
digital statitics of voice 1 a same length signal
mean of voice 1:-0.000105
standard deviation of voice 1:0.251742
variance of voice 1:0.063374
average power of voice 1:0.063374
average magnitude of voice 1:0.197595
11. digital statitics of voice 2
mean of voice 2:-0.000105
standard deviation of voice 2:0.251742
variance of voice 2:0.063374
average power of voice 2:0.063374
average magnitude of voice 2:0.197595
correlation
[C1, lag1] = xcorr(abs((fft(voice1))),abs((fft(voice2)) ));
figure, plot(lag1/fs1,C1);
ylabel('Amplitude'); grid on
title('Cross-correlation between Correct and User loading files')
% %% plot orginal signal. for debug. %% team does not like long length
% %% perform fft and plot of orignal signal
% %
% figure; subplot (2,2,1); plot(t1, sound1);
% title ('Signal of sound 1 , frequency = 44100 Hz and number sample =
2742270');
% xlabel('time (sec)'); ylabel('relative signal strength'); grid on;
% %
% subplot (2,2,2); plot(t2, sound2);
% title ('Signal of sound 2, frequency = 44100 Hz and number sample =
2674665');
% xlabel('time (sec)'); ylabel('relative signal strength'); grid on;
% %% fft of orignal signal
% NFFT1 = 2 ^ nextpow2(N);
% Y1 = fft(y1, NFFT1)/ N;
% f1 = (fs1 / 2 * linspace(0, 1, NFFT1 / 2+1))'; % Vector containing
frequencies in Hz
% STFFT1 = ( 2 * abs(Y1(1: NFFT1 / 2+1))); % Vector containing corresponding
amplitudes
% subplot (2,2,3); plot(f1, STFFT1); title ('Single-sided Power spectrum for
Sound1');
% %subplot (2,2,3); plot(abs(fft(sound1))); title ('plot fft of Sound 1');
%plot Magnitude of fft
% ylabel ('Magnitude |y(f)|'); xlabel ('frequency [Hz]'); grid on;
%
% NFFT2 = 2 ^ nextpow2(N2);
% Y2 = fft(y2, NFFT2) / N2;
% f2 = (fs2 / 2 * linspace(0, 1, NFFT2 / 2+1))'; % Vector containing
frequencies in Hz
% STFFT2 = ( 2 * abs(Y2(1: NFFT2 / 2+1))); % Vector containing corresponding
amplitudes
% subplot (2,2,4); plot(f2, STFFT2); title ('Single-sided Power spectrum for
Sound2');
% % subplot (2,2,4); plot(abs(fft(sound2))); title ('plot fft of Sound2');
% ylabel ('Magnitude |y(f)|'); xlabel ('frequency [Hz]'); grid on;