溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

使用Python怎么模擬脈沖星偽信號(hào)頻率

發(fā)布時(shí)間:2021-04-30 15:57:16 來源:億速云 閱讀:156 作者:Leah 欄目:開發(fā)技術(shù)

使用Python怎么模擬脈沖星偽信號(hào)頻率?相信很多沒有經(jīng)驗(yàn)的人對(duì)此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個(gè)問題。

python主要應(yīng)用領(lǐng)域有哪些

1、云計(jì)算,典型應(yīng)用OpenStack。2、WEB前端開發(fā),眾多大型網(wǎng)站均為Python開發(fā)。3.人工智能應(yīng)用,基于大數(shù)據(jù)分析和深度學(xué)習(xí)而發(fā)展出來的人工智能本質(zhì)上已經(jīng)無法離開python。4、系統(tǒng)運(yùn)維工程項(xiàng)目,自動(dòng)化運(yùn)維的標(biāo)配就是python+Django/flask。5、金融理財(cái)分析,量化交易,金融分析。6、大數(shù)據(jù)分析。

實(shí)例代碼:

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation

# Fixing random state for reproducibility
np.random.seed(19680801)


# Create new Figure with black background
fig = plt.figure(figsize=(8, 8), facecolor='black')

# Add a subplot with no frame
ax = plt.subplot(111, frameon=False)

# Generate random data
data = np.random.uniform(0, 1, (64, 75))
X = np.linspace(-1, 1, data.shape[-1])
G = 1.5 * np.exp(-4 * X ** 2)

# Generate line plots
lines = []
for i in range(len(data)):
  # Small reduction of the X extents to get a cheap perspective effect
  xscale = 1 - i / 200.
  # Same for linewidth (thicker strokes on bottom)
  lw = 1.5 - i / 100.0
  line, = ax.plot(xscale * X, i + G * data[i], color="w", lw=lw)
  lines.append(line)

# Set y limit (or first line is cropped because of thickness)
ax.set_ylim(-1, 70)

# No ticks
ax.set_xticks([])
ax.set_yticks([])

# 2 part titles to get different font weights
ax.text(0.5, 1.0, "MATPLOTLIB ", transform=ax.transAxes,
    ha="right", va="bottom", color="w",
    family="sans-serif", fontweight="light", fontsize=16)
ax.text(0.5, 1.0, "UNCHAINED", transform=ax.transAxes,
    ha="left", va="bottom", color="w",
    family="sans-serif", fontweight="bold", fontsize=16)


def update(*args):
  # Shift all data to the right
  data[:, 1:] = data[:, :-1]

  # Fill-in new values
  data[:, 0] = np.random.uniform(0, 1, len(data))

  # Update data
  for i in range(len(data)):
    lines[i].set_ydata(i + G * data[i])

  # Return modified artists
  return lines

# Construct the animation, using the update function as the animation
# director.
anim = animation.FuncAnimation(fig, update, interval=10)
plt.show()

看完上述內(nèi)容,你們掌握使用Python怎么模擬脈沖星偽信號(hào)頻率的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI