处理来自 .wav 的信号并将其转换为二进制数据
我将无线电信号录制成.wav,我可以大胆地打开它,看到其中有使用某种算法编码的二进制数据。有谁知道处理 .wav 中包含的信号的方法吗?这样我就可以从中提取二进制数据?
我知道我需要知道编码算法才能正常工作,有人知道有任何程序可以执行类似的操作吗?
谢谢
I recorded a radio signal into a .wav, I can open it in audacity and see that there is binary data encoded using a certain algorithm. Does anyone know of a way to process the signal that is contained within the .wav? so that i can extract the binary data from it?
I know that I need to know the encoding algorithm for it to work properly, anyone know of any program that does something like that?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
.wav 格式通常非常简单,并且 wav 文件通常没有压缩数据。自己解析它是相当可行的,但使用已经制作的东西要容易得多。因此,简短的答案是找到可以读取您选择的语言的 wav 文件的东西。
这是一个 Python 示例,使用 wave 模块:
现在你去哪里取决于关于你还想做什么。
binary_data
现在是原始字节的 python 字符串。如果您只想将其切碎并重新包装,那么将其保留为这种形式可能是最简单的。如果您想操作数据,例如缩放、插值、过滤等,您可能希望将其转换为数字序列,为此,在 Python 中,您需要将其转换为 numpy 数组。您可以使用 struct 模块自行执行此操作,该模块用于将字符串解释为打包的二进制数据,或者您可以使用 scipy.io.wave 模块可以为您完成此操作。正如您所看到的,其中大部分很快就会变得相当依赖于语言。The .wav format is generally very simple and wav files usually don't have compressed data. It's quite feasible to parse it yourself, but much easier to use something already made. So the short answer is to find something that can read wav files in your language of choice.
Here's an example in Python, using the wave module:
Now where you go depends on what else you want to do.
binary_data
is now a python string of the raw bytes. If you just want to chop this and repackage it, it's probably easiest to leave it in this form. If you want to manipulated the data, such as scale it, interpolate, filter, etc, you would probably want to convert this into a sequence of numbers, and for this, in Python, you'd want to convert it to a numpy array. You could do this yourself using the struct module, which is for interpreting strings as packed binary data, or you could just have read in the data using scipy.io.wave module which does this for you. As you can see, most of this becomes fairly language dependent quickly.sox 会将大多数音频格式转换为大多数其他音频格式 - 包括原始二进制文件。
sox will convert most audio formats to most other audio formats - including raw binary.