How does one make an Amplitude vs. Frequency plot?

In summary, the conversation is about the speaker's struggle with writing a python function to produce an amplitude vs frequency plot for a physics lab course. They mention having previously written a function for simulating data from a sine wave, but are unsure where to begin with this new problem. They have calculated the frequency resolution and are stuck on how to extract the amplitude of each frequency component from a set of data points. The speaker also clarifies that they are not asking for programming advice, but rather conceptual guidance. They mention using a python plotting library and eventually realizing that they just needed to use the standard scipy fft function in their own function.
  • #1
Daniel Sellers
117
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
  • #3
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.
 

1. How do you collect the data for an Amplitude vs. Frequency plot?

The data for an Amplitude vs. Frequency plot is typically collected using a device called a spectrum analyzer. This device measures the amplitude and frequency of a signal and displays it on a graph.

2. What is the purpose of an Amplitude vs. Frequency plot?

The purpose of an Amplitude vs. Frequency plot is to show the relationship between the amplitude and frequency of a signal. This can help identify the dominant frequencies in a signal and their corresponding amplitudes.

3. How do you interpret an Amplitude vs. Frequency plot?

In an Amplitude vs. Frequency plot, the amplitude is typically plotted on the y-axis and the frequency is plotted on the x-axis. The height of each point on the plot represents the amplitude at that particular frequency. The frequency at which the amplitude is highest is known as the dominant frequency.

4. What factors can affect the shape of an Amplitude vs. Frequency plot?

The shape of an Amplitude vs. Frequency plot can be affected by various factors such as the type of signal being analyzed, the presence of noise, and the sensitivity of the measuring device. Additionally, the characteristics of the measuring device, such as its frequency range and resolution, can also impact the shape of the plot.

5. How can an Amplitude vs. Frequency plot be used in scientific research?

An Amplitude vs. Frequency plot can be used in various scientific fields, such as physics, engineering, and biology, to analyze and understand the characteristics of different types of signals. It can also be used for troubleshooting and diagnosing issues in electronic systems that involve signals of different frequencies.

Similar threads

Replies
5
Views
366
Replies
9
Views
1K
  • Introductory Physics Homework Help
Replies
2
Views
575
Replies
12
Views
994
  • Introductory Physics Homework Help
Replies
17
Views
384
  • Introductory Physics Homework Help
Replies
8
Views
1K
Replies
24
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
8
Views
2K
Replies
1
Views
2K
Replies
46
Views
3K
Back
Top