SlideShare una empresa de Scribd logo
1 de 1
Descargar para leer sin conexión
MATLAB CODING
Say I had a signal = T
and I computed the the fourier transform so X = fft(T)
and I computed a suitable frequency vector k = linspace(-fs/2,fs/2,length(X)+1)
k = k(1:end-1)
I need to find the peaks in the magnitude spectrum (which in this case occur over values of 1)
and from them find the corresponding amplitude and angle to these peaks.
I'm assuming it would go something like
[peaks,locs] = findpeaks(abs(X)./fs,k,'MinPeakHeight',1)
amplitude = X(locs)
phase = angle(X(locs))
Any advice would be great
Solution
%MATLAB Code begins
%Vector T contains the input signal which is to be analyzed and fs is the sampling frequency
y = fft(t); %computing the Fast Fourier Transform
l = length(T); %storing the length of input signal
f = fs * (0:l-1) / l; %defining the frequency domain of the Fourier Transform
[pks,locs] = findpeaks(y,'MinPeakHeight',1); %finding the peaks and their locations in the
Fourier Transform
abs(y(locs)) %displaying the amplitude of peaks
angle(y(locs)) %displaying the angle of peaks
f(locs) %displaying the frequencies corresponding to which the peaks occur
%MATLAB Code ends

Más contenido relacionado

Similar a MATLAB CODINGSay I had a signal = Tand I computed the the fourie.pdf

Computational Method to Solve the Partial Differential Equations (PDEs)
Computational Method to Solve the Partial Differential  Equations (PDEs)Computational Method to Solve the Partial Differential  Equations (PDEs)
Computational Method to Solve the Partial Differential Equations (PDEs)Dr. Khurram Mehboob
 
Fourier transform
Fourier transformFourier transform
Fourier transformShahed Babu
 
Ss important questions
Ss important questionsSs important questions
Ss important questionsSowji Laddu
 
Stochastic Calculus, Summer 2014, July 22,Lecture 7Con.docx
Stochastic Calculus, Summer 2014, July 22,Lecture 7Con.docxStochastic Calculus, Summer 2014, July 22,Lecture 7Con.docx
Stochastic Calculus, Summer 2014, July 22,Lecture 7Con.docxdessiechisomjj4
 
Ch4 (1)_fourier series, fourier transform
Ch4 (1)_fourier series, fourier transformCh4 (1)_fourier series, fourier transform
Ch4 (1)_fourier series, fourier transformShalabhMishra10
 
Pulse Modulation ppt
Pulse Modulation pptPulse Modulation ppt
Pulse Modulation pptsanjeev2419
 
Fourier Series for Continuous Time & Discrete Time Signals
Fourier Series for Continuous Time & Discrete Time SignalsFourier Series for Continuous Time & Discrete Time Signals
Fourier Series for Continuous Time & Discrete Time SignalsJayanshu Gundaniya
 
pulse modulation technique (Pulse code modulation).pptx
pulse modulation technique (Pulse code modulation).pptxpulse modulation technique (Pulse code modulation).pptx
pulse modulation technique (Pulse code modulation).pptxNishanth Asmi
 
Harmonic wave physics
Harmonic wave physicsHarmonic wave physics
Harmonic wave physicsLawrence Ma
 
On Spaces of Entire Functions Having Slow Growth Represented By Dirichlet Series
On Spaces of Entire Functions Having Slow Growth Represented By Dirichlet SeriesOn Spaces of Entire Functions Having Slow Growth Represented By Dirichlet Series
On Spaces of Entire Functions Having Slow Growth Represented By Dirichlet SeriesIOSR Journals
 
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
 
Fixed Point Theorm In Probabilistic Analysis
Fixed Point Theorm In Probabilistic AnalysisFixed Point Theorm In Probabilistic Analysis
Fixed Point Theorm In Probabilistic Analysisiosrjce
 

Similar a MATLAB CODINGSay I had a signal = Tand I computed the the fourie.pdf (20)

Fourier series
Fourier seriesFourier series
Fourier series
 
Computational Method to Solve the Partial Differential Equations (PDEs)
Computational Method to Solve the Partial Differential  Equations (PDEs)Computational Method to Solve the Partial Differential  Equations (PDEs)
Computational Method to Solve the Partial Differential Equations (PDEs)
 
Fourier transform
Fourier transformFourier transform
Fourier transform
 
AJMS_402_22_Reprocess_new.pdf
AJMS_402_22_Reprocess_new.pdfAJMS_402_22_Reprocess_new.pdf
AJMS_402_22_Reprocess_new.pdf
 
Ss important questions
Ss important questionsSs important questions
Ss important questions
 
unit 4,5 (1).docx
unit 4,5 (1).docxunit 4,5 (1).docx
unit 4,5 (1).docx
 
Stochastic Calculus, Summer 2014, July 22,Lecture 7Con.docx
Stochastic Calculus, Summer 2014, July 22,Lecture 7Con.docxStochastic Calculus, Summer 2014, July 22,Lecture 7Con.docx
Stochastic Calculus, Summer 2014, July 22,Lecture 7Con.docx
 
Ft3 new
Ft3 newFt3 new
Ft3 new
 
Ch4 (1)_fourier series, fourier transform
Ch4 (1)_fourier series, fourier transformCh4 (1)_fourier series, fourier transform
Ch4 (1)_fourier series, fourier transform
 
Dsp manual
Dsp manualDsp manual
Dsp manual
 
Pulse Modulation ppt
Pulse Modulation pptPulse Modulation ppt
Pulse Modulation ppt
 
Fourier Series for Continuous Time & Discrete Time Signals
Fourier Series for Continuous Time & Discrete Time SignalsFourier Series for Continuous Time & Discrete Time Signals
Fourier Series for Continuous Time & Discrete Time Signals
 
pulse modulation technique (Pulse code modulation).pptx
pulse modulation technique (Pulse code modulation).pptxpulse modulation technique (Pulse code modulation).pptx
pulse modulation technique (Pulse code modulation).pptx
 
Harmonic wave physics
Harmonic wave physicsHarmonic wave physics
Harmonic wave physics
 
Laplace transform
Laplace transformLaplace transform
Laplace transform
 
senior seminar
senior seminarsenior seminar
senior seminar
 
On Spaces of Entire Functions Having Slow Growth Represented By Dirichlet Series
On Spaces of Entire Functions Having Slow Growth Represented By Dirichlet SeriesOn Spaces of Entire Functions Having Slow Growth Represented By Dirichlet Series
On Spaces of Entire Functions Having Slow Growth Represented By Dirichlet Series
 
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
 
z transforms
z transformsz transforms
z transforms
 
Fixed Point Theorm In Probabilistic Analysis
Fixed Point Theorm In Probabilistic AnalysisFixed Point Theorm In Probabilistic Analysis
Fixed Point Theorm In Probabilistic Analysis
 

Más de Akashayhandicraft789

Miceconomics African elephants arc endangered, but cows are not beca.pdf
Miceconomics African elephants arc endangered, but cows are not beca.pdfMiceconomics African elephants arc endangered, but cows are not beca.pdf
Miceconomics African elephants arc endangered, but cows are not beca.pdfAkashayhandicraft789
 
Metrology (What it is, What it encompasses, how it relates to Qualit.pdf
Metrology (What it is, What it encompasses, how it relates to Qualit.pdfMetrology (What it is, What it encompasses, how it relates to Qualit.pdf
Metrology (What it is, What it encompasses, how it relates to Qualit.pdfAkashayhandicraft789
 
metals frequently form solutions with other atoms. What are the two .pdf
metals frequently form solutions with other atoms. What are the two .pdfmetals frequently form solutions with other atoms. What are the two .pdf
metals frequently form solutions with other atoms. What are the two .pdfAkashayhandicraft789
 
Merell (1997), studied the effects of different kinds of music on th.pdf
Merell (1997), studied the effects of different kinds of music on th.pdfMerell (1997), studied the effects of different kinds of music on th.pdf
Merell (1997), studied the effects of different kinds of music on th.pdfAkashayhandicraft789
 
Mendelian inheritance. Some traits of plants and animals depend on i.pdf
Mendelian inheritance. Some traits of plants and animals depend on i.pdfMendelian inheritance. Some traits of plants and animals depend on i.pdf
Mendelian inheritance. Some traits of plants and animals depend on i.pdfAkashayhandicraft789
 
Mel OConner owns rental properties in Michigan. Each property has .pdf
Mel OConner owns rental properties in Michigan. Each property has .pdfMel OConner owns rental properties in Michigan. Each property has .pdf
Mel OConner owns rental properties in Michigan. Each property has .pdfAkashayhandicraft789
 
Medication adherence among HIV+ adultsEffects of cognitive dysfun.pdf
Medication adherence among HIV+ adultsEffects of cognitive dysfun.pdfMedication adherence among HIV+ adultsEffects of cognitive dysfun.pdf
Medication adherence among HIV+ adultsEffects of cognitive dysfun.pdfAkashayhandicraft789
 
Media specialists know that receivers engage in selective retention,.pdf
Media specialists know that receivers engage in selective retention,.pdfMedia specialists know that receivers engage in selective retention,.pdf
Media specialists know that receivers engage in selective retention,.pdfAkashayhandicraft789
 
Measuring treatment outcomes asSolutionThe following is an ext.pdf
Measuring treatment outcomes asSolutionThe following is an ext.pdfMeasuring treatment outcomes asSolutionThe following is an ext.pdf
Measuring treatment outcomes asSolutionThe following is an ext.pdfAkashayhandicraft789
 
Measures of central tendency give information about typical scores i.pdf
Measures of central tendency give information about typical scores i.pdfMeasures of central tendency give information about typical scores i.pdf
Measures of central tendency give information about typical scores i.pdfAkashayhandicraft789
 
MC#4 Which of the following statements is most CORRECT a. In a typ.pdf
MC#4 Which of the following statements is most CORRECT a. In a typ.pdfMC#4 Which of the following statements is most CORRECT a. In a typ.pdf
MC#4 Which of the following statements is most CORRECT a. In a typ.pdfAkashayhandicraft789
 
May a minor enter into a contract with an adult Are both parties eq.pdf
May a minor enter into a contract with an adult Are both parties eq.pdfMay a minor enter into a contract with an adult Are both parties eq.pdf
May a minor enter into a contract with an adult Are both parties eq.pdfAkashayhandicraft789
 
Maximum combustion temperature in gas turbines is of the order of 11.pdf
Maximum combustion temperature in gas turbines is of the order of 11.pdfMaximum combustion temperature in gas turbines is of the order of 11.pdf
Maximum combustion temperature in gas turbines is of the order of 11.pdfAkashayhandicraft789
 
Math Analysis questionPlease determine compactness and connectedn.pdf
Math Analysis questionPlease determine compactness and connectedn.pdfMath Analysis questionPlease determine compactness and connectedn.pdf
Math Analysis questionPlease determine compactness and connectedn.pdfAkashayhandicraft789
 
Materials questions The intersections of which two lines in a phase.pdf
Materials questions The intersections of which two lines in a phase.pdfMaterials questions The intersections of which two lines in a phase.pdf
Materials questions The intersections of which two lines in a phase.pdfAkashayhandicraft789
 
Match the term with the letter corresponding to the definition in th.pdf
Match the term with the letter corresponding to the definition in th.pdfMatch the term with the letter corresponding to the definition in th.pdf
Match the term with the letter corresponding to the definition in th.pdfAkashayhandicraft789
 
Match the proposed probability of A with the appropriate verbal desc.pdf
Match the proposed probability of A with the appropriate verbal desc.pdfMatch the proposed probability of A with the appropriate verbal desc.pdf
Match the proposed probability of A with the appropriate verbal desc.pdfAkashayhandicraft789
 

Más de Akashayhandicraft789 (17)

Miceconomics African elephants arc endangered, but cows are not beca.pdf
Miceconomics African elephants arc endangered, but cows are not beca.pdfMiceconomics African elephants arc endangered, but cows are not beca.pdf
Miceconomics African elephants arc endangered, but cows are not beca.pdf
 
Metrology (What it is, What it encompasses, how it relates to Qualit.pdf
Metrology (What it is, What it encompasses, how it relates to Qualit.pdfMetrology (What it is, What it encompasses, how it relates to Qualit.pdf
Metrology (What it is, What it encompasses, how it relates to Qualit.pdf
 
metals frequently form solutions with other atoms. What are the two .pdf
metals frequently form solutions with other atoms. What are the two .pdfmetals frequently form solutions with other atoms. What are the two .pdf
metals frequently form solutions with other atoms. What are the two .pdf
 
Merell (1997), studied the effects of different kinds of music on th.pdf
Merell (1997), studied the effects of different kinds of music on th.pdfMerell (1997), studied the effects of different kinds of music on th.pdf
Merell (1997), studied the effects of different kinds of music on th.pdf
 
Mendelian inheritance. Some traits of plants and animals depend on i.pdf
Mendelian inheritance. Some traits of plants and animals depend on i.pdfMendelian inheritance. Some traits of plants and animals depend on i.pdf
Mendelian inheritance. Some traits of plants and animals depend on i.pdf
 
Mel OConner owns rental properties in Michigan. Each property has .pdf
Mel OConner owns rental properties in Michigan. Each property has .pdfMel OConner owns rental properties in Michigan. Each property has .pdf
Mel OConner owns rental properties in Michigan. Each property has .pdf
 
Medication adherence among HIV+ adultsEffects of cognitive dysfun.pdf
Medication adherence among HIV+ adultsEffects of cognitive dysfun.pdfMedication adherence among HIV+ adultsEffects of cognitive dysfun.pdf
Medication adherence among HIV+ adultsEffects of cognitive dysfun.pdf
 
Media specialists know that receivers engage in selective retention,.pdf
Media specialists know that receivers engage in selective retention,.pdfMedia specialists know that receivers engage in selective retention,.pdf
Media specialists know that receivers engage in selective retention,.pdf
 
Measuring treatment outcomes asSolutionThe following is an ext.pdf
Measuring treatment outcomes asSolutionThe following is an ext.pdfMeasuring treatment outcomes asSolutionThe following is an ext.pdf
Measuring treatment outcomes asSolutionThe following is an ext.pdf
 
Measures of central tendency give information about typical scores i.pdf
Measures of central tendency give information about typical scores i.pdfMeasures of central tendency give information about typical scores i.pdf
Measures of central tendency give information about typical scores i.pdf
 
MC#4 Which of the following statements is most CORRECT a. In a typ.pdf
MC#4 Which of the following statements is most CORRECT a. In a typ.pdfMC#4 Which of the following statements is most CORRECT a. In a typ.pdf
MC#4 Which of the following statements is most CORRECT a. In a typ.pdf
 
May a minor enter into a contract with an adult Are both parties eq.pdf
May a minor enter into a contract with an adult Are both parties eq.pdfMay a minor enter into a contract with an adult Are both parties eq.pdf
May a minor enter into a contract with an adult Are both parties eq.pdf
 
Maximum combustion temperature in gas turbines is of the order of 11.pdf
Maximum combustion temperature in gas turbines is of the order of 11.pdfMaximum combustion temperature in gas turbines is of the order of 11.pdf
Maximum combustion temperature in gas turbines is of the order of 11.pdf
 
Math Analysis questionPlease determine compactness and connectedn.pdf
Math Analysis questionPlease determine compactness and connectedn.pdfMath Analysis questionPlease determine compactness and connectedn.pdf
Math Analysis questionPlease determine compactness and connectedn.pdf
 
Materials questions The intersections of which two lines in a phase.pdf
Materials questions The intersections of which two lines in a phase.pdfMaterials questions The intersections of which two lines in a phase.pdf
Materials questions The intersections of which two lines in a phase.pdf
 
Match the term with the letter corresponding to the definition in th.pdf
Match the term with the letter corresponding to the definition in th.pdfMatch the term with the letter corresponding to the definition in th.pdf
Match the term with the letter corresponding to the definition in th.pdf
 
Match the proposed probability of A with the appropriate verbal desc.pdf
Match the proposed probability of A with the appropriate verbal desc.pdfMatch the proposed probability of A with the appropriate verbal desc.pdf
Match the proposed probability of A with the appropriate verbal desc.pdf
 

Último

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 

Último (20)

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 

MATLAB CODINGSay I had a signal = Tand I computed the the fourie.pdf

  • 1. MATLAB CODING Say I had a signal = T and I computed the the fourier transform so X = fft(T) and I computed a suitable frequency vector k = linspace(-fs/2,fs/2,length(X)+1) k = k(1:end-1) I need to find the peaks in the magnitude spectrum (which in this case occur over values of 1) and from them find the corresponding amplitude and angle to these peaks. I'm assuming it would go something like [peaks,locs] = findpeaks(abs(X)./fs,k,'MinPeakHeight',1) amplitude = X(locs) phase = angle(X(locs)) Any advice would be great Solution %MATLAB Code begins %Vector T contains the input signal which is to be analyzed and fs is the sampling frequency y = fft(t); %computing the Fast Fourier Transform l = length(T); %storing the length of input signal f = fs * (0:l-1) / l; %defining the frequency domain of the Fourier Transform [pks,locs] = findpeaks(y,'MinPeakHeight',1); %finding the peaks and their locations in the Fourier Transform abs(y(locs)) %displaying the amplitude of peaks angle(y(locs)) %displaying the angle of peaks f(locs) %displaying the frequencies corresponding to which the peaks occur %MATLAB Code ends