Preview

Fourier Transform Assignment

Satisfactory Essays
Open Document
Open Document
736 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Fourier Transform Assignment
Jiawei Huang
37154135

Fourier Transform Assignment

1. Fourier transform of sine wave (code): import numpy as np import matplotlib.pyplot as plt from scipy.fftpack import fft,fftfreq dt = 0.01 time = np.arange(0,5.,dt) f_1 = 3. a_1 = 2.3 y = a_1*np.sin(2.*np.pi*time*f_1) plt.plot(time,y) plt.xlabel("Time t [s]") plt.ylabel("Wave") plt.title("Wave Signal") plt.show() n = time.shape[-1] transform = (fft(y)[:n/2]) * 2./n frequency = fftfreq(n,time[1]-time[0])[:n/2] plt.plot(frequency,np.abs(transform)) plt.xlabel("Frequency f [Hz]") plt.ylabel("Amplitude") plt.title("Fourier Transform")

Input:

Output:

(code): import numpy as np import matplotlib.pyplot as plt from scipy.fftpack import fft,fftfreq dt = 0.01 time = np.arange(0,5.,dt) f_1 = 3. a_1 = 2.3 f_2 = 2.5 a_2 = 2 f_3 = 1.5 a_3 = 1.8 y = a_1*np.sin(2.*np.pi*time*f_1)+a_2*np.sin(2.*np.pi*time*f_2)+a_3*np.sin(2.*np.pi*time*f_3) plt.plot(time,y) plt.xlabel("Time t [s]") plt.ylabel("Wave") plt.title("Wave Signal") plt.show() n = time.shape[-1] transform = (fft(y)[:n/2]) * 2./n frequency = fftfreq(n,time[1]-time[0])[:n/2] plt.plot(frequency,np.abs(transform)) plt.xlabel("Frequency f [Hz]") plt.ylabel("Amplitude") plt.title("Fourier Transform")

Input:

Output:

Discussion:

There are three peaks one Fourier transform diagram that represent three waves with different frequencies. The height of each peak is the amplitude of each wave, while the position of each peak represents their frequencies.

2. Fourier transform of a square wave (code): import numpy as np import matplotlib.pyplot as plt from scipy.fftpack import fft,fftfreq data = np.loadtxt('squareWave.csv', delimiter=',') time = data[:,0] y = data[:,1] plt.plot(time,y) plt.xlabel("Time t [s]")
plt.ylabel("Wave")

You May Also Find These Documents Helpful

  • Better Essays

    Jft2 Task 2

    • 1445 Words
    • 4 Pages

    In analyzing the Utah Symphony and Utah Opera merger case study, it was obvious that many factors, finances, personalities, and even the community would be involved. The wide reaching affects of a merger between these two types of organizations was eye opening. At the time of the proposed merger, the Utah Opera had a stronger financial footing and was not in danger of closing. The Utah Symphony however, was sliding down a dangerous financial slope. The organizations were structured differently in their number of employees and financial compensation packages. These differences would prove challenging in a merger and could be the basis Bill Bailey would use to oppose such a merger.…

    • 1445 Words
    • 4 Pages
    Better Essays
  • Satisfactory Essays

    Answers Lab06 ECG

    • 446 Words
    • 4 Pages

    4. Draw an ECG wave form representing one heartbeat. Label the P, QRS, and T waves; the P-R interval; the S-T segment; and…

    • 446 Words
    • 4 Pages
    Satisfactory Essays
  • Good Essays

    Sc121 Unit 2 Assignment

    • 985 Words
    • 4 Pages

    In this unit we are talking about Cholesterol and how a group of organic compounds make up 18-25% of one’s body mass called lipids. So why are lipids important? Lipids are important because they are used in the body to transport vitamins, they are essential in breaking down Cholesterol and they are used for body insulation. Lipids are best obtained from vegetable oils and legumes. But, the question is can the body produce essential fatty acids (ETA’S)? No, our body is not able to produce these fatty acids on its own. So it is necessary that you eat a diet rich in these crucial building blocks to maintain a healthy body. Two main essential fatty acids are to be included in our diet are the Omega-3 and Omega-6.…

    • 985 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    Unit 2 Assignment 1

    • 235 Words
    • 1 Page

    A common problem that happens is assuming as soon as DHCP options are changed that all PCs will automatically implement them.…

    • 235 Words
    • 1 Page
    Satisfactory Essays
  • Satisfactory Essays

    Unit 2 Assignment 1

    • 603 Words
    • 3 Pages

    In a 1-page paper, compare the different service provide types: RBOCS, ILEC, CLEC, MSO and ISP.…

    • 603 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Int1 Unit 1 Assignment

    • 589 Words
    • 3 Pages

    INT1 Task 1 Jamie Hildebrand Hurricane Satellite Image, NOAA, n.d., retrieved from: http://www.noaa.gov/features/02_monitoring/inland_flooding.html Weather Forecasts From folklore and proverbs to modern radar technology, the scientific understanding of weather prediction has evolved through time. Several inventions such as the thermometer, barometer and even satellites have given way to immense knowledge of weather conditions. Mild, sunny days are perfect for picnics, but those aren’t the weather conditions that led to the advances in weather predictions. “Severe weather events such as tornadoes, tropical storms, hurricanes, floods, lightning strikes and extremes of heat or cold can be costly and deadly.…

    • 589 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    Unit 4 Assignment 2

    • 717 Words
    • 3 Pages

    The purpose of this policy is to define standards for connecting to Richman investment’s network from any host. These standards are designed to minimize the potential exposure to Richman investments from damages which may result from unauthorized use of Richman investments resources. Damages include the loss of sensitive or company confidential data, intellectual property, damage to public image, damage to critical Richman investments internal systems, etc.…

    • 717 Words
    • 3 Pages
    Powerful Essays
  • Powerful Essays

    Unit 2 Assignment 1

    • 1912 Words
    • 8 Pages

    A heat sink is an electronic device that has been designed specifically to draw heat away from the CPU and prevent it from overheating. However, the heat sink itself can become too hot sometimes. So therefore, a fan is often used to keep cool both of the CPU and the heat sink.…

    • 1912 Words
    • 8 Pages
    Powerful Essays
  • Good Essays

    USA, is one of the oldest democracies, the power distance is average while its very high in China, a communist country and also average in Pakistan. In Pakistan, the people believe that the power is concentrated only among a very few people and is not open to the commoners. Individualism is high in USA and with Pakistan having a very low score of 14 it is considered a collectivistic society. This is manifest in a close long-term commitment to the member 'group', be that a family, extended family, or extended relationships. Loyalty in a collectivist culture is paramount, and over-rides most other societal rules and regulations. The society fosters strong relationships…

    • 647 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    unit 3 assignment 4

    • 4187 Words
    • 14 Pages

    It is not only individuals in the consumer marketplace that have the potential to buy, as buyers also exist in the business to business market. B2B markets are individuals that have the responsibility of purchasing on behalf of the business. Cadbury have both individual and business to business consumers. They trade with all major supermarkets and superstores, but also sell to local and private shops. This way they can broaden their distribution and reach customers and consumers everywhere.…

    • 4187 Words
    • 14 Pages
    Powerful Essays
  • Satisfactory Essays

    Unit 2 Assignment 1

    • 356 Words
    • 2 Pages

    4. What is a discourse community? To what discourse communities do you belong? How does a discourse community help establish common ground for its members?…

    • 356 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    unit 2 assignment 1

    • 522 Words
    • 2 Pages

    2. How can a reader use the rhetorical situation to analyze an argument essay? How can a viewer use the rhetorical situation to analyze an image? How can a writer use the rhetorical situation during the planning phase of writing a paper?…

    • 522 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Unit 2 Assignment 1

    • 352 Words
    • 2 Pages

    My name is Destiny Knott, my family and I have recently moved into a house overlooking the park in the neighborhood of Park Hall. I would like to draw your attention to some of the lewd and lascivious acts that take place daily in Park Hall. On many separate occasions up to several times a day, I have noticed from my window or front porch a crowd of undesirable individuals sitting on the benches. Numerous times these individuals have been seen drinking alcohol and carrying on very loudly, using the foulest kind of language. On another occasion my family and I have witnessed a violent fight occur right in front of the park where all of our children play. It is an outrage that our young innocent children should have to listen to and witness such inappropriate displays of behavior.…

    • 352 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Unit 3 Assignment 1

    • 260 Words
    • 1 Page

    Living with Hodgkin’s disease is not easy. Being diagnosed with Hodgkin's disease changes everything in your life, and the lives of those around you. People living with cancer may worry about what the future holds. They may worry about holding their jobs, caring for their families, personal relationships, or continuing with daily activities. Concerns about tests, treatments, hospital stays, and medical bills are also common. Doctors, nurses, and other members of the health care team can answer questions about treatment, working, or other activities. Meeting with a social worker, counselor, psychologist, or member of the clergy can be helpful to people who want to talk about their feelings or discuss their concerns. Often, a social worker can suggest groups that can help with rehabilitation, emotional support, financial aid, transportation, or home care.…

    • 260 Words
    • 1 Page
    Satisfactory Essays
  • Satisfactory Essays

    Unit 4 Assignment 4

    • 340 Words
    • 2 Pages

    One the first steps in implementing an effective security plan is to periodically assess Organizational risks. Identifying and mitigating risk will help in establishing a security management structure and assigning security responsibilities. Without having an understanding of your risk you are unable to determine the proper security policies, procedures, guidelines, and standards to put in place to ensure adequate security controls are implemented. The risk assessment provides a baseline for implementing security plans to protect assets against threats. Within the risk assessment some basic questions must be answered, What assets within the organization need protection, What are the risks to each of these assets, How much time, effort, and money is the organization willing to spend to upgrade or obtain new adequate protection against these threats?…

    • 340 Words
    • 2 Pages
    Satisfactory Essays