资源简介
python源代码,界面美观,能实现音乐播放,变频,混响,画波形图等功能,原数字信号处理作业。
代码片段和文件信息
# -*- coding: utf-8 -*-
“““
Created on Sun Mar 23 02:12:12 2014
@author: lsh
“““
import ossys
from PyQt4 import phonon
from PyQt4.phonon import Phonon
from PyQt4.Qt import QApplication SIGNAL QFileDialog QIcon
from PyQt4 import QtCore QtGui
#import media_modified
import numpy
import scipy.signal as signal
from pylab import *
import wave
###########################################################
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context text disambig):
return QtGui.QApplication.translate(context text disambig _encoding)
except AttributeError:
def _translate(context text disambig):
return QtGui.QApplication.translate(context text disambig)
##################################################################
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4 import NavigationToolbar2QT as NavigationToolbar
from matplotlib.figure import Figure
class MyMplCanvas(FigureCanvas):
def __init__(self parent=None width = 10 height = 12 dpi = 100 sharex = None sharey = None):
self.fig = Figure(figsize = (width height) dpi=dpi facecolor = ‘#FFFFFF‘)
self.bx = self.fig.add_subplot(111 sharex = sharex sharey = sharey)
self.ax = self.fig.add_subplot(111 sharex = sharex sharey = sharey)
self.fig.subplots_adjust(left=0 bottom=0 right=1 top=1)
self.xtitle=“ “
self.ytitle=“ “
# self.Plottitle = “FFT spectral“
self.Plottitle = ““
self.grid_status = True
self.xaxis_style = ‘linear‘
self.yaxis_style = ‘linear‘
self.format_labels()
self.ax.hold(True)
FigureCanvas.__init__(self self.fig)
FigureCanvas.setSizePolicy(self
QSizePolicy.Expanding
QSizePolicy.Expanding)
FigureCanvas.updateGeometry(self)
def format_labels(self):
self.ax.set_title(self.Plottitle)
self.ax.title.set_fontsize(10)
self.ax.set_xlabel(self.xtitle fontsize = 9)
self.ax.set_ylabel(self.ytitle fontsize = 9)
labels_x = self.ax.get_xticklabels()
labels_y = self.ax.get_yticklabels()
for xlabel in labels_x:
#xlabel.set_fontsize(8)
xlabel.set_fontsize(1)
for ylabel in labels_y:
ylabel.set_fontsize(1)
#ylabel.set_color(‘b‘)
self.bx.set_title(self.Plottitle)
self.bx.title.set_fontsize(10)
self.bx.set_xlabel(self.xtitle fontsize = 1)
self.bx.set_ylabel(self.ytitle fontsize = 1)
labels_x1 = self.bx.get_xticklabels()
labels_y1 = self.bx.get_yticklabels()
for xlabel in labels_x1:
xlabel.set_fontsize(1)
for ylabel in labels_y1:
ylabel.set_fontsize(1)
ylabel.set_color(‘b‘)
def sizeHint(self):
w h = self.get_width_height()
return QSize(w h)
def
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 88244 2014-03-03 15:11 DSP_homework\hellokugou.wav
文件 27472 2014-03-25 23:11 DSP_homework\media_final.py
文件 247 2014-03-23 19:35 DSP_homework\Pause.png
文件 384 2014-03-23 19:36 DSP_homework\Play.png
文件 312 2014-03-23 19:36 DSP_homework\Stop.png
文件 25203 2014-03-24 00:34 DSP_homework\window.png
目录 0 2014-04-08 16:27 DSP_homework
----------- --------- ---------- ----- ----
141862 7
相关资源
- C4.5决策树算法的Python代码和数据样本
- 树莓派利用python、opencv、PyALPR识别车
- python 数独游戏源码
- 爬取某块区域的实时交通态势数据,
- Anaconda3-5.3.1-Windows-x86_64 (Python3.x版本
- DS_Store文件泄漏利用python脚本
- ArcGIS10.1中利用python语言批量实现遥感
- 用自己的数据制作python版本cifar10数据
- python遗传算法求函数极值.py
- Python教程.rar
- python数据挖掘分类聚类回归关联算法
- Python爬虫源码—爬取猫途鹰官方旅游
- 密度聚类(Density peaks Clustering)Pyth
- python摄像头视频显示到TK窗口
- 国际麻将AI-根据向听数计算最优操作
- 爬取瓜子二手车.py
- 人脸识别UI Pythone+pyq5+opencv 多线程模式
- pcap-1.1.win32-py2.7.exe
- Python制作的汉诺塔演示小脚本
- python django+bootstrap实现用户管理系统
- python+MySQL+bootstrap+ajax项目
- 基于Python的双路视频传输及双显示系
- python模型restful接口
- Python3—EM&GMM;
- python+numpy实现自适应阈值分割函数O
- python+numpy实现均值滤波
- python代码实现录音
- 初学者练习python编程的100个小程序
- python入门到实践 外星人入侵项目代码
- 合并BN层的python脚本
评论
共有 条评论