处理来自 .wav 的信号并将其转换为二进制数据

发布于 2024-09-08 14:51:02 字数 150 浏览 11 评论 0原文

我将无线电信号录制成.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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

转角预定愛 2024-09-15 14:51:03

.wav 格式通常非常简单,并且 wav 文件通常没有压缩数据。自己解析它是相当可行的,但使用已经制作的东西要容易得多。因此,简短的答案是找到可以读取您选择的语言的 wav 文件的东西。

这是一个 Python 示例,使用 wave 模块:

import wave

w = wave.open("myfile.wav", "rb")
binary_data = w.readframes(w.getnframes())
w.close()

现在你去哪里取决于关于你还想做什么。 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:

import wave

w = wave.open("myfile.wav", "rb")
binary_data = w.readframes(w.getnframes())
w.close()

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.

上课铃就是安魂曲 2024-09-15 14:51:02

sox 会将大多数音频格式转换为大多数其他音频格式 - 包括原始二进制文件。

sox will convert most audio formats to most other audio formats - including raw binary.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文