I How does one make an Amplitude vs. Frequency plot?

AI Thread Summary
To create an amplitude vs. frequency plot from sine wave data, one must first calculate the frequency resolution, ∆v, which relies on the sampling frequency and the number of data points. The key step is to use the Fast Fourier Transform (FFT) from the SciPy library to extract the amplitude of each frequency component from the time series data. After realizing the complexity of building a function from scratch, it became clear that leveraging existing libraries like SciPy and Matplotlib simplifies the process significantly. The discussion highlights the importance of understanding the conceptual framework before diving into coding. Ultimately, using established functions can streamline the creation of the desired plot.
Daniel Sellers
Messages
117
Reaction score
17
I am working on homework for a physics lab course and I am asked to write a python function which will produce an amplitude v.s frequency plot. In a previous problem I wrote a function which simulates data from a sine wave in the form of a time series; the new function should be able to take this data as input and produce a plot.

I am somewhat at a loss as to where to begin with this problem. I have worked some with amplitude vs frequency plots in the lab, but I haven't been asked to produce one before and after a couple hours I still don't have a starting point.

To be clear, I'm not asking for programming advice, I'll figure out the code after I know what I'm doing conceptually.

I have calculated ∆v, the frequency resolution which depends on the sampling frequency and number of data points taken but I am stuck on this: given a set of data points from a sine wave, how do I extract the amplitude of each frequency component?

Sorry if the language used here is somewhat unclear, I will happily clarify anything doesn't make sense above.
 
Mathematics news on Phys.org
Yes, it turns out that I just needed to work the standard scipy fft function into my own function and configure it to accept a time series array as input.

Thanks for your reply, turns out I was just overcomplicating things by trying to write a function to plot amplitude vs. frequency from scratch.
 
Suppose ,instead of the usual x,y coordinate system with an I basis vector along the x -axis and a corresponding j basis vector along the y-axis we instead have a different pair of basis vectors ,call them e and f along their respective axes. I have seen that this is an important subject in maths My question is what physical applications does such a model apply to? I am asking here because I have devoted quite a lot of time in the past to understanding convectors and the dual...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Back
Top