Mathematica : WAV 파일 편집 및 저장
Wolfram Mathematica를 사용하면 WAV 파일을 가져오고 분석하고 편집하고 내보낼 수 있습니다. 방법을 알려 드리겠습니다.
WAV 파일을 Mathematica로 가져 오기
간단한 명령 "audio = Import [path, command]"를 사용하면 WAV 파일의 데이터를 Mathematica로 가져올 수 있습니다. 경로와 명령을 인용해야합니다. 쉬운 경로 입력을위한 도움말은 사진 갤러리에 있습니다. 다음 명령을 사용하여 WAV 파일의 다양한 요소를로드 할 수 있습니다.
- "요소"는 Mathematica로 가져올 수있는 WAV 파일 정보를 보여줍니다.
- "AudioChannels"는 WAV 파일에 포함 된 채널 수를 알려줍니다.
- "SampleRate"는 샘플 속도를 출력합니다
- "AudioEncoding"은 샘플이 인코딩되는 방법을 나타냅니다. 일반적으로이 값은 "Integer16"과 "Integer32"사이에 있습니다 (즉, 16 ~ 32 비트의 정수). 4 ~ 64 비트의 인코딩이 가능합니다.
- "데이터"는 각 라인에서 채널의 RAW 데이터를 포함하는 매트릭스입니다. 경고 :이 매트릭스에는 모든 오디오 자료가 포함되기 때문에 때로는 매우 클 수 있습니다. 최대 4GB의 파일을로드 할 수 있습니다. 여기서 반드시 ";"를 사용해야합니다. 데이터 출력을 억제합니다. 매트릭스에 "audio"라는 이름을 지정 했으므로 계속 작업 할 수 있습니다.
- "사운드"사용 Mathematica는 파형 및 스펙트럼 디스플레이와 작은 플레이어를 포함하여 파일을로드하여 사운드를 재생합니다.
- "규칙"을 사용하면 모든 정보를 행렬로 가져옵니다. 6 개의 라인에는 "AudioChannels", "AudioEncoding", "Data", "SampledSoundList", "SampleRate"및 "Sound"가이 순서로 포함됩니다. 주의 :이 매트릭스는 오디오 파일 자체보다 훨씬 크기 때문에 ";"로 데이터를 출력해야합니다. 억제.
Mathematica에서 WAV 파일 분석 및 편집
"데이터"를 사용하여 가져온 RAW 데이터는 다른 테이블과 마찬가지로 Mathematica에서 사용 및 편집 할 수 있습니다. 다음 명령은 오디오 자료에 특히 유용합니다.
- 이제 "오디오"매트릭스에 값을 표시하고 원하는대로 변경할 수 있습니다.
- "치수 [오디오]"는 행과 열의 수, 즉 채널당 샘플 수를 제공합니다.
- "area = Take [audio [[X, All]], {start value, end value}];"사용 채널 X의 일부를 제거 할 수 있습니다.
- "푸리에 스펙트럼 [영역] = 「 이 부분에 대한 푸리에 분석을 수행합니다.
- 스펙트럼 성분을 마음대로 변경할 수도 있습니다.
- "Re [spectrum]", "Im [spectrum]", "Abs [spectrum]"및 "Arg [spectrum]"은 스펙트럼 성분의 실수 부, 허수 부, 진폭 및 위상을 출력합니다.
Mathematica에서 WAV 파일 내보내기
조작 된 오디오 데이터를 WAV 파일로 다시 만들려면 "Export [path, command]"를 입력하십시오. WAV 파일을 올바르게 설정하려면 다음 명령을 사용하십시오.
- 내보내기 전에 "audio / = Max [Abs [audio];]"를 사용해야합니다. | 1 | 정상화. 1보다 크고 -1보다 작은 값은 무시됩니다.
- ""SampleRate "-> 44100"은 오디오 자료를 초당 44100 개의 샘플로 내 보냅니다.
- ""AudioEncoding "->"Integer16 ""는 오디오 파일을 샘플 당 16 비트로 인코딩합니다.
- ""AudioChannels "-> 2"를 사용하면 오디오 자료에 더 많은 채널이 포함되어 있어도 처음 2 개의 채널 만 내보낼 수 있습니다.
Wolfram Alpha에 대한 팁은 여기에서 찾을 수 있습니다. Audacity 프로그램을 사용하는 방법. 우리는 여기에 설명합니다.
최신 비디오
Mathematica에 경로를 입력하는 것은 약간 지루합니다. 경로는 따옴표로 묶고 폴더는 슬래시 기호 "/"로 구분되지 않고 두 개의 백 슬래시 "\\"로 구분됩니다. 탐색기에서 경로를 복사하는 것만으로는 작동하지 않습니다.
가장 쉬운 방법은 "삽입"-> "파일 경로를 사용하는 것입니다.
"선택 ... "파일 경로
"선택 ...">
"파일 경로
"선택 ..."/>
"선택 ..."/>
탐색기 창에서 원하는 파일로 이동하십시오. Mathematica는 정확한 철자로 파일 경로를 기록합니다.