rfft或irfft增加python中的wav文件量 [英] rfft or irfft increasing wav file volume in python

查看:114
本文介绍了rfft或irfft增加python中的wav文件量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始编写程序来处理python中的某些音频.在编写任何滤波功能之前,我想做一个测试,以在输入信号经过rfft和irfft之后将输入信号与输出信号进行比较.由于某种原因,与输入文件相比,输出文件具有令人难以置信的增益(50db!),我不知道为什么会这样. 这是代码:

I have just started writing a program to manipulate some audio in python. Before I write any filtering functions, I wanted to do a test to compare the input signal to the output signal after having the input signal go through an rfft and irfft. For some reason the output file has an incredible amount of gain in it (50db!) compared to the input file, and I can't figure out why this is happening. Here is the code:

from scipy.io.wavfile import read, write
from scipy.fftpack import rfft, irfft
import numpy as np

rate, input = read('5and10ksm.wav')
transformed = rfft(input) 
output = irfft(transformed)
write('smaller.wav', rate, output)

谢谢!

推荐答案

查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆