SlideShare a Scribd company logo
1 of 2
Download to read offline
That assignment had 2 part. I already complated part 1. and collected the phasor frequency and
magnitude datas. My code is here: I need to write a new code to answer those question. Please
help me i dont know how to do those. Many thanks.
You can find .wav file from this website any .wav file will be
okay.http://www.grsites.com/archive/sounds/category/10/
HERE IS MY PART 1 OF THIS ASSIGNMENT CODE.
clc
clear all
[y, Fs] = audioread('chirp.wav'); % Reading file
Fs = 8192; % Sampling frequency
N=length(y);
T=1/Fs;
Fmax=Fs/2;
T0=N*T; %duration of the signal.
t =[1/Fs:1/Fs:N/Fs] % Time Vector
sound(y,Fs); % Plays .wav file
hold on
subplot(3,1,1);
plot(t,y, 'c'); % Plots input signal
xlabel('Time');
ylabel('Amplitude');
title('Input Signal')
Xr=fft(y); %use FFT to find DFT
freq1 =[-Fmax:Fs/N:Fmax-(Fs/N)];
%freq1 = linspace(1,Fs,length(y)); %%%frequency vector
subplot(3,1,2);
a=fftshift(Xr);
c=abs(a);
plot(freq1, c, 'r'); %%%Stem Plot
xlabel('Freq');
ylabel('Amplitude');
title('Fourier Transform (Magnitude)');
Xr_phase=angle(a); %Calculation of %phase
subplot(3,1,3);
plot(freq1,Xr_phase,'g') %Use %fftshift to %shift zero frequency component
xlabel('Phase');
ylabel('Frequency');
title('Phase Plot');
%%% saving text file in ASCII foramt%%
% 1st column- frequency%%
% 2nd column- magnitude components%%
% 3rd column- phase (deg) components%%
A(:,1)=freq1;
A(:,2)=c;
A(:,3)=Xr_phase;
save('parameters.txt','A', '-ASCII')
THIS PART HAS BEEN COMPLETED NO NEED TO RE DO IT AGAIN. ITS CODE IS IN
THE ABOVE. This picture is only information purposes to understand part 2 of the assignment.
Signal Synthesizer (part-2) 1. Read the analyzed value (magnitude, phase and frequency) from
ASCII files. 2. Re-create sinusoid using the following equation for each set of (magnitude, phase
and frequency) A Cos (2nft G) 3. Combine all sinusoids and plot the signal (this is regenerated
signal). 4. Compare this combined signal with original chirp signal 5. Play the regenerated signal
(It should sound like the original audio signal). 6. Store the synthesized audio signal in a WAV
file (name it chirp synthesized.wav).
Solution
freq2=A(:,1)'%freq Components;
c2=A(:,2)';%magnitude components
Xr_phase2=A(:,3)'; %phase (deg) components%%;
for i=1:1:length(c2)
signalA(i)=c2(i)*cos((2*pi*freq2(i)*t(i))+Xr_phase2(i));
end
figure(2)
plot(t,signalA);
sound(signalA,Fs);

More Related Content

Similar to That assignment had 2 part. I already complated part 1. and collecte.pdf

Matlab 2
Matlab 2Matlab 2
Matlab 2asguna
 
Generics, Reflection, and Efficient Collections
Generics, Reflection, and Efficient CollectionsGenerics, Reflection, and Efficient Collections
Generics, Reflection, and Efficient CollectionsEleanor McHugh
 
Matlab code for comparing two microphone files
Matlab code for comparing two microphone filesMatlab code for comparing two microphone files
Matlab code for comparing two microphone filesMinh Anh Nguyen
 
Matlab code for comparing two microphone files
Matlab code for comparing two microphone filesMatlab code for comparing two microphone files
Matlab code for comparing two microphone filesMinh Anh Nguyen
 
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLABDIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLABMartin Wachiye Wafula
 
Solvedproblems 120406031331-phpapp01
Solvedproblems 120406031331-phpapp01Solvedproblems 120406031331-phpapp01
Solvedproblems 120406031331-phpapp01Rimple Mahey
 

Similar to That assignment had 2 part. I already complated part 1. and collecte.pdf (7)

Matlab 2
Matlab 2Matlab 2
Matlab 2
 
Generics, Reflection, and Efficient Collections
Generics, Reflection, and Efficient CollectionsGenerics, Reflection, and Efficient Collections
Generics, Reflection, and Efficient Collections
 
Matlab code for comparing two microphone files
Matlab code for comparing two microphone filesMatlab code for comparing two microphone files
Matlab code for comparing two microphone files
 
Matlab code for comparing two microphone files
Matlab code for comparing two microphone filesMatlab code for comparing two microphone files
Matlab code for comparing two microphone files
 
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLABDIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
 
Solvedproblems 120406031331-phpapp01
Solvedproblems 120406031331-phpapp01Solvedproblems 120406031331-phpapp01
Solvedproblems 120406031331-phpapp01
 
Asr
AsrAsr
Asr
 

More from arrowvisionoptics

Every day when she first wakes up, Elena takes three foul shots on a.pdf
Every day when she first wakes up, Elena takes three foul shots on a.pdfEvery day when she first wakes up, Elena takes three foul shots on a.pdf
Every day when she first wakes up, Elena takes three foul shots on a.pdfarrowvisionoptics
 
Be more apt to have a mentor than men.        Have dreams (.pdf
Be more apt to have a mentor than men.        Have dreams (.pdfBe more apt to have a mentor than men.        Have dreams (.pdf
Be more apt to have a mentor than men.        Have dreams (.pdfarrowvisionoptics
 
Answer the following questions. EMB is considered to be both a _ medi.pdf
Answer the following questions. EMB is considered to be both a _ medi.pdfAnswer the following questions. EMB is considered to be both a _ medi.pdf
Answer the following questions. EMB is considered to be both a _ medi.pdfarrowvisionoptics
 
A. The statement Evolutionists cannot point to any transitional fo.pdf
A. The statement Evolutionists cannot point to any transitional fo.pdfA. The statement Evolutionists cannot point to any transitional fo.pdf
A. The statement Evolutionists cannot point to any transitional fo.pdfarrowvisionoptics
 
Culture of bacteria is having trouble dividing. Choose from the list.pdf
Culture of bacteria is having trouble dividing. Choose from the list.pdfCulture of bacteria is having trouble dividing. Choose from the list.pdf
Culture of bacteria is having trouble dividing. Choose from the list.pdfarrowvisionoptics
 
Create a class named Student that has the following member variables.pdf
Create a class named Student that has the following member variables.pdfCreate a class named Student that has the following member variables.pdf
Create a class named Student that has the following member variables.pdfarrowvisionoptics
 
You identify four mutant strains that cannot synthesize Compound E. E.pdf
You identify four mutant strains that cannot synthesize Compound E. E.pdfYou identify four mutant strains that cannot synthesize Compound E. E.pdf
You identify four mutant strains that cannot synthesize Compound E. E.pdfarrowvisionoptics
 
9. Identify at least two factors that influence the degree of stoc.pdf
9. Identify at least two factors that influence the degree of stoc.pdf9. Identify at least two factors that influence the degree of stoc.pdf
9. Identify at least two factors that influence the degree of stoc.pdfarrowvisionoptics
 
What are the fuctional need of a roadWhat is road building system.pdf
What are the fuctional need of a roadWhat is road building system.pdfWhat are the fuctional need of a roadWhat is road building system.pdf
What are the fuctional need of a roadWhat is road building system.pdfarrowvisionoptics
 
Why does Germany have to be assertive in the EUSolutionAnswer.pdf
Why does Germany have to be assertive in the EUSolutionAnswer.pdfWhy does Germany have to be assertive in the EUSolutionAnswer.pdf
Why does Germany have to be assertive in the EUSolutionAnswer.pdfarrowvisionoptics
 
What is the link between wealth and welfare Do governments have a r.pdf
What is the link between wealth and welfare Do governments have a r.pdfWhat is the link between wealth and welfare Do governments have a r.pdf
What is the link between wealth and welfare Do governments have a r.pdfarrowvisionoptics
 
Which of the following are ways nutrients can enter the root cells .pdf
Which of the following are ways nutrients can enter the root cells  .pdfWhich of the following are ways nutrients can enter the root cells  .pdf
Which of the following are ways nutrients can enter the root cells .pdfarrowvisionoptics
 
What is E coliSolutionE.coli is a bacteria that normally live.pdf
What is E coliSolutionE.coli is a bacteria that normally live.pdfWhat is E coliSolutionE.coli is a bacteria that normally live.pdf
What is E coliSolutionE.coli is a bacteria that normally live.pdfarrowvisionoptics
 
Where does mitosis occur in the bodies of vascular plantsSoluti.pdf
Where does mitosis occur in the bodies of vascular plantsSoluti.pdfWhere does mitosis occur in the bodies of vascular plantsSoluti.pdf
Where does mitosis occur in the bodies of vascular plantsSoluti.pdfarrowvisionoptics
 
Which of the following are the three properties of dataA. mean, m.pdf
Which of the following are the three properties of dataA. mean, m.pdfWhich of the following are the three properties of dataA. mean, m.pdf
Which of the following are the three properties of dataA. mean, m.pdfarrowvisionoptics
 
What is the range of clinical signssymptoms of C. difficile infecti.pdf
What is the range of clinical signssymptoms of C. difficile infecti.pdfWhat is the range of clinical signssymptoms of C. difficile infecti.pdf
What is the range of clinical signssymptoms of C. difficile infecti.pdfarrowvisionoptics
 
What was Kants ideas regarding retributive punishmentSolution.pdf
What was Kants ideas regarding retributive punishmentSolution.pdfWhat was Kants ideas regarding retributive punishmentSolution.pdf
What was Kants ideas regarding retributive punishmentSolution.pdfarrowvisionoptics
 
What are the major events that occur during each stage in the life cy.pdf
What are the major events that occur during each stage in the life cy.pdfWhat are the major events that occur during each stage in the life cy.pdf
What are the major events that occur during each stage in the life cy.pdfarrowvisionoptics
 
What challenges do corporations face with regards to social media.pdf
What challenges do corporations face with regards to social media.pdfWhat challenges do corporations face with regards to social media.pdf
What challenges do corporations face with regards to social media.pdfarrowvisionoptics
 
Use De Moivres theorem to change the given complex number to the fo.pdf
Use De Moivres theorem to change the given complex number to the fo.pdfUse De Moivres theorem to change the given complex number to the fo.pdf
Use De Moivres theorem to change the given complex number to the fo.pdfarrowvisionoptics
 

More from arrowvisionoptics (20)

Every day when she first wakes up, Elena takes three foul shots on a.pdf
Every day when she first wakes up, Elena takes three foul shots on a.pdfEvery day when she first wakes up, Elena takes three foul shots on a.pdf
Every day when she first wakes up, Elena takes three foul shots on a.pdf
 
Be more apt to have a mentor than men.        Have dreams (.pdf
Be more apt to have a mentor than men.        Have dreams (.pdfBe more apt to have a mentor than men.        Have dreams (.pdf
Be more apt to have a mentor than men.        Have dreams (.pdf
 
Answer the following questions. EMB is considered to be both a _ medi.pdf
Answer the following questions. EMB is considered to be both a _ medi.pdfAnswer the following questions. EMB is considered to be both a _ medi.pdf
Answer the following questions. EMB is considered to be both a _ medi.pdf
 
A. The statement Evolutionists cannot point to any transitional fo.pdf
A. The statement Evolutionists cannot point to any transitional fo.pdfA. The statement Evolutionists cannot point to any transitional fo.pdf
A. The statement Evolutionists cannot point to any transitional fo.pdf
 
Culture of bacteria is having trouble dividing. Choose from the list.pdf
Culture of bacteria is having trouble dividing. Choose from the list.pdfCulture of bacteria is having trouble dividing. Choose from the list.pdf
Culture of bacteria is having trouble dividing. Choose from the list.pdf
 
Create a class named Student that has the following member variables.pdf
Create a class named Student that has the following member variables.pdfCreate a class named Student that has the following member variables.pdf
Create a class named Student that has the following member variables.pdf
 
You identify four mutant strains that cannot synthesize Compound E. E.pdf
You identify four mutant strains that cannot synthesize Compound E. E.pdfYou identify four mutant strains that cannot synthesize Compound E. E.pdf
You identify four mutant strains that cannot synthesize Compound E. E.pdf
 
9. Identify at least two factors that influence the degree of stoc.pdf
9. Identify at least two factors that influence the degree of stoc.pdf9. Identify at least two factors that influence the degree of stoc.pdf
9. Identify at least two factors that influence the degree of stoc.pdf
 
What are the fuctional need of a roadWhat is road building system.pdf
What are the fuctional need of a roadWhat is road building system.pdfWhat are the fuctional need of a roadWhat is road building system.pdf
What are the fuctional need of a roadWhat is road building system.pdf
 
Why does Germany have to be assertive in the EUSolutionAnswer.pdf
Why does Germany have to be assertive in the EUSolutionAnswer.pdfWhy does Germany have to be assertive in the EUSolutionAnswer.pdf
Why does Germany have to be assertive in the EUSolutionAnswer.pdf
 
What is the link between wealth and welfare Do governments have a r.pdf
What is the link between wealth and welfare Do governments have a r.pdfWhat is the link between wealth and welfare Do governments have a r.pdf
What is the link between wealth and welfare Do governments have a r.pdf
 
Which of the following are ways nutrients can enter the root cells .pdf
Which of the following are ways nutrients can enter the root cells  .pdfWhich of the following are ways nutrients can enter the root cells  .pdf
Which of the following are ways nutrients can enter the root cells .pdf
 
What is E coliSolutionE.coli is a bacteria that normally live.pdf
What is E coliSolutionE.coli is a bacteria that normally live.pdfWhat is E coliSolutionE.coli is a bacteria that normally live.pdf
What is E coliSolutionE.coli is a bacteria that normally live.pdf
 
Where does mitosis occur in the bodies of vascular plantsSoluti.pdf
Where does mitosis occur in the bodies of vascular plantsSoluti.pdfWhere does mitosis occur in the bodies of vascular plantsSoluti.pdf
Where does mitosis occur in the bodies of vascular plantsSoluti.pdf
 
Which of the following are the three properties of dataA. mean, m.pdf
Which of the following are the three properties of dataA. mean, m.pdfWhich of the following are the three properties of dataA. mean, m.pdf
Which of the following are the three properties of dataA. mean, m.pdf
 
What is the range of clinical signssymptoms of C. difficile infecti.pdf
What is the range of clinical signssymptoms of C. difficile infecti.pdfWhat is the range of clinical signssymptoms of C. difficile infecti.pdf
What is the range of clinical signssymptoms of C. difficile infecti.pdf
 
What was Kants ideas regarding retributive punishmentSolution.pdf
What was Kants ideas regarding retributive punishmentSolution.pdfWhat was Kants ideas regarding retributive punishmentSolution.pdf
What was Kants ideas regarding retributive punishmentSolution.pdf
 
What are the major events that occur during each stage in the life cy.pdf
What are the major events that occur during each stage in the life cy.pdfWhat are the major events that occur during each stage in the life cy.pdf
What are the major events that occur during each stage in the life cy.pdf
 
What challenges do corporations face with regards to social media.pdf
What challenges do corporations face with regards to social media.pdfWhat challenges do corporations face with regards to social media.pdf
What challenges do corporations face with regards to social media.pdf
 
Use De Moivres theorem to change the given complex number to the fo.pdf
Use De Moivres theorem to change the given complex number to the fo.pdfUse De Moivres theorem to change the given complex number to the fo.pdf
Use De Moivres theorem to change the given complex number to the fo.pdf
 

Recently uploaded

male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................MirzaAbrarBaig5
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project researchCaitlinCummins3
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital ManagementMBA Assignment Experts
 
ANTI PARKISON DRUGS.pptx
ANTI         PARKISON          DRUGS.pptxANTI         PARKISON          DRUGS.pptx
ANTI PARKISON DRUGS.pptxPoojaSen20
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFVivekanand Anglo Vedic Academy
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17Celine George
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMELOISARIVERA8
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxAdelaideRefugio
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesAmanpreetKaur157993
 
Climbers and Creepers used in landscaping
Climbers and Creepers used in landscapingClimbers and Creepers used in landscaping
Climbers and Creepers used in landscapingDr. M. Kumaresan Hort.
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi RajagopalEADTU
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhleson0603
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptxPoojaSen20
 
Scopus Indexed Journals 2024 - ISCOPUS Publications
Scopus Indexed Journals 2024 - ISCOPUS PublicationsScopus Indexed Journals 2024 - ISCOPUS Publications
Scopus Indexed Journals 2024 - ISCOPUS PublicationsISCOPE Publication
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportDenish Jangid
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code ExamplesPeter Brusilovsky
 

Recently uploaded (20)

male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
ANTI PARKISON DRUGS.pptx
ANTI         PARKISON          DRUGS.pptxANTI         PARKISON          DRUGS.pptx
ANTI PARKISON DRUGS.pptx
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
Climbers and Creepers used in landscaping
Climbers and Creepers used in landscapingClimbers and Creepers used in landscaping
Climbers and Creepers used in landscaping
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptx
 
Scopus Indexed Journals 2024 - ISCOPUS Publications
Scopus Indexed Journals 2024 - ISCOPUS PublicationsScopus Indexed Journals 2024 - ISCOPUS Publications
Scopus Indexed Journals 2024 - ISCOPUS Publications
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 

That assignment had 2 part. I already complated part 1. and collecte.pdf

  • 1. That assignment had 2 part. I already complated part 1. and collected the phasor frequency and magnitude datas. My code is here: I need to write a new code to answer those question. Please help me i dont know how to do those. Many thanks. You can find .wav file from this website any .wav file will be okay.http://www.grsites.com/archive/sounds/category/10/ HERE IS MY PART 1 OF THIS ASSIGNMENT CODE. clc clear all [y, Fs] = audioread('chirp.wav'); % Reading file Fs = 8192; % Sampling frequency N=length(y); T=1/Fs; Fmax=Fs/2; T0=N*T; %duration of the signal. t =[1/Fs:1/Fs:N/Fs] % Time Vector sound(y,Fs); % Plays .wav file hold on subplot(3,1,1); plot(t,y, 'c'); % Plots input signal xlabel('Time'); ylabel('Amplitude'); title('Input Signal') Xr=fft(y); %use FFT to find DFT freq1 =[-Fmax:Fs/N:Fmax-(Fs/N)]; %freq1 = linspace(1,Fs,length(y)); %%%frequency vector subplot(3,1,2); a=fftshift(Xr); c=abs(a); plot(freq1, c, 'r'); %%%Stem Plot xlabel('Freq'); ylabel('Amplitude'); title('Fourier Transform (Magnitude)'); Xr_phase=angle(a); %Calculation of %phase subplot(3,1,3); plot(freq1,Xr_phase,'g') %Use %fftshift to %shift zero frequency component
  • 2. xlabel('Phase'); ylabel('Frequency'); title('Phase Plot'); %%% saving text file in ASCII foramt%% % 1st column- frequency%% % 2nd column- magnitude components%% % 3rd column- phase (deg) components%% A(:,1)=freq1; A(:,2)=c; A(:,3)=Xr_phase; save('parameters.txt','A', '-ASCII') THIS PART HAS BEEN COMPLETED NO NEED TO RE DO IT AGAIN. ITS CODE IS IN THE ABOVE. This picture is only information purposes to understand part 2 of the assignment. Signal Synthesizer (part-2) 1. Read the analyzed value (magnitude, phase and frequency) from ASCII files. 2. Re-create sinusoid using the following equation for each set of (magnitude, phase and frequency) A Cos (2nft G) 3. Combine all sinusoids and plot the signal (this is regenerated signal). 4. Compare this combined signal with original chirp signal 5. Play the regenerated signal (It should sound like the original audio signal). 6. Store the synthesized audio signal in a WAV file (name it chirp synthesized.wav). Solution freq2=A(:,1)'%freq Components; c2=A(:,2)';%magnitude components Xr_phase2=A(:,3)'; %phase (deg) components%%; for i=1:1:length(c2) signalA(i)=c2(i)*cos((2*pi*freq2(i)*t(i))+Xr_phase2(i)); end figure(2) plot(t,signalA); sound(signalA,Fs);