-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_new.py
50 lines (45 loc) · 1.01 KB
/
test_new.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from modulefinder import Module
import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import sys
# from numpy import linspace
#
from data.data_loader import Dataset_ETT_hour
import time
import pandas as pd
from scipy.fftpack import dct, idct
import matplotlib.pyplot as plt
import numpy as np
# data = pd.read_csv('/Users/marc-antoine/Documents/S7/物理实验/UV3600/1.txt', sep=',')
# print(data.columns)
#
# font2 = {'weight': 'normal',
# 'size': 14,
# }
#
# x = data['NM'][:5000].to_numpy()
# y = data['INTEN'][:5000].to_numpy()
# x = x.astype(np.float)
# y = y.astype(np.float)
#
# plt.plot(x[:], y[:])
# plt.xlabel('{}/nm'.format(chr(955)), font2)
# plt.ylabel('U/V', font2)
# plt.grid()
# plt.xlim(500, 650)
# plt.ylim(0)
#
# plt.savefig('/Users/marc-antoine/Documents/temp/shangyong.jpg')
# plt.show()
x = np.linspace(0, 10, 10000)
c = np.cos(100*x)
y = np.exp(-np.power(x, 2))
plt.plot(x, y*c)
plt.xlim(0, 4)
plt.show()
y = idct(y)
plt.plot(x, y)
plt.xlim(0, 0.05)
plt.show()