[go: up one dir, main page]

Jump to content

File:Periodogram.svg

Page contents not supported in other languages.
This is a file from the Wikimedia Commons
From Wikipedia, the free encyclopedia

Original file (SVG file, nominally 540 × 360 pixels, file size: 42 KB)

Summary

Description
English: A power spectrum of two sinusoidal basis functions, calculated by the periodogram method. The significance of basis functions is that there is no spectral leakage into the neighboring frequency bins.
Date
Source Own work based on code from File:Periodogram.png by Kirlf (talk · contribs)
Author Ixfd64

Source code

import numpy as np
from scipy import signal
import matplotlib.pyplot as plt

w_1 = 30  # frequency of the 1st component of the signal (Hz)
w_2 = 50  # frequency of the 2nd component of the signal (Hz)

a = 1.1  # magnitude of the 1st component of the signal
b = 0.6  # magnitude of the 2nd component of the signal

t = np.array([i for i in range(1, 301)]) / 1000  # time samples (s)
fs = 1 / (t[1] - t[0])  # sampling frequency (Hz)

x = a * np.cos(2 * np.pi * w_1 * t) + b * np.sin(2 * np.pi * w_2 * t)  # considered signal
f, Pxx_den = signal.periodogram(x, fs=fs, scaling='spectrum')

plt.subplots(1, 1, figsize=(6, 4), dpi=250)
plt.stem(f[:50], Pxx_den[:50], '-')
plt.ylabel('Spectrum')
plt.xlabel('Frequencies (Hz)')
plt.title('Periodogram')
plt.grid(True)
plt.savefig("Periodogram.svg")

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

copyrighted<\/a>"}},"text\/plain":{"en":{"P6216":"copyrighted"}}}}" class="wbmi-entityview-statementsGroup wbmi-entityview-statementsGroup-P6216 oo-ui-layout oo-ui-panelLayout oo-ui-panelLayout-framed">
Creative Commons Attribution-ShareAlike 4.0 International<\/a>"}},"text\/plain":{"en":{"P275":"Creative Commons Attribution-ShareAlike 4.0 International"}}}}" class="wbmi-entityview-statementsGroup wbmi-entityview-statementsGroup-P275 oo-ui-layout oo-ui-panelLayout oo-ui-panelLayout-framed">
original creation by uploader<\/a>"}},"text\/plain":{"en":{"P7482":"original creation by uploader"}}}}" class="wbmi-entityview-statementsGroup wbmi-entityview-statementsGroup-P7482 oo-ui-layout oo-ui-panelLayout oo-ui-panelLayout-framed">

2 May 2023

image/svg+xml

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current21:57, 2 May 2023Thumbnail for version as of 21:57, 2 May 2023540 × 360 (42 KB)Ixfd64Uploaded own work with UploadWizard

The following 2 pages use this file:

Global file usage

The following other wikis use this file:

Metadata