Mathematica: Muokkaa ja tallenna WAV-tiedostoja
Wolfram Mathematica -sovelluksella voit tuoda, analysoida, muokata ja viedä WAV-tiedostoja. Kerromme sinulle kuinka.
Tuo WAV-tiedostot Mathematicaan
Yksinkertaisella komennolla "audio = Tuo [polku, komento]" voit tuoda tietoja WAV-tiedostoista Mathematicaan. Polku ja komento on ilmoitettava. Apua reitin helppoon merkitsemiseen annetaan kuvagalleriassa. Voit ladata WAV-tiedoston eri osia seuraavilla komennoilla:
- "Elements" näyttää mitä WAV-tiedoston tietoja voit tuoda Mathematicaan
- "AudioChannels" kertoo WAV-tiedostoon upotettujen kanavien lukumäärän.
- "SampleRate" tuottaa näytteenottotaajuuden
- "AudioEncoding" osoittaa kuinka näytteet koodataan. Arvo on yleensä "Integer16" ja "Integer32", eli kokonaislukuja, joiden bitti on 16-32. Koodaukset 4 - 64 bittiä ovat mahdollisia.
- "Data" on matriisi, joka sisältää kanavan RAW-tiedot jokaisella rivillä. Varoitus: Koska tämä matriisi sisältää kaiken äänimateriaalin, se voi joskus olla erittäin suuri. Enintään 4 Gt: n tiedostoja voidaan ladata. Tässä sinun tulisi ehdottomasti käyttää ";" tukahduttaa datan ulostulon. Koska annoit matriisille nimen "audio", voit jatkaa työskentelyä sen kanssa.
- "Äänen" käyttäminen Mathematica lataa tiedoston, joka sisältää aaltomuodon ja taajuusnäytön sekä pienen soittimen äänen toistamiseksi.
- "Säännöillä" kaikki tiedot tuodaan matriisiin. Kuusi riviä sisältävät "AudioChannels", "AudioEncoding", "Data", "SampledSoundList", "SampleRate" ja "Sound" tässä järjestyksessä. Varoitus: Tämä matriisi on huomattavasti suurempi kuin itse äänitiedosto, joten sinun tulisi ehdottomasti tulostaa tiedot ";" tukahduttaa.
Analysoi ja muokkaa WAV-tiedostoja Mathematicassa
"Data" -toiminnolla tuotua RAW-tietoa voidaan käyttää ja muokata Mathematicassa kuten mitä tahansa muuta taulukkoa. Seuraavat komennot ovat erityisen mielenkiintoisia äänimateriaalille:
- Voit nyt näyttää minkä tahansa arvon "audio" -matriisissa ja muuttaa sitä haluamallasi tavalla.
- "Mitat [ääni]" antaa sinulle rivien ja sarakkeiden määrän, ts. Näytteiden määrän kanavaa kohti.
- Käyttämällä "alue = Ota [ääni [[X, kaikki]], {aloitusarvo, loppuarvo}];" voit poistaa osan kanavasta X.
- "Spectrum = Fourier [alue];" tekee Fourier-analyysin tästä osasta.
- Voit myös muuttaa spektrikomponentteja haluttaessa.
- "Re [spektri]", "Im [spektri]", "Abs [spektri]" ja "Arg [spektri]" tuottavat spektrikomponenttien todellisen osan, kuvitteellisen osan, amplitudin ja vaiheen.
Vie WAV-tiedostoja Mathematicasta
Jos haluat tehdä manipuloidusta äänidatasta taas WAV-tiedoston, kirjoita "Vie [polku, komento]". Aseta WAV-tiedosto oikein seuraavilla komennoilla:
- Ennen vientiä sinun tulisi käyttää "audio / = Max [Abs [audio];]") päällä | 1 | normalisoituu. Yli 1 ja alle -1 arvot ohitetaan.
- "" SampleRate "-> 44100" vie äänimateriaalia nopeudella 44100 näytettä sekunnissa.
- "" AudioEncoding "->" Integer16 "" koodaa äänitiedoston 16 bitillä per näyte.
- "" AudioChannels "-> 2" -toiminnolla voit varmistaa, että vain kaksi ensimmäistä kanavaa viedään, vaikka äänimateriaali sisältää enemmän kanavia.
Löydät vinkkejä Wolfram Alfasta täältä. Kuinka työskennellä Audacity-ohjelman kanssa. selitämme täällä.
Uusimmat videot
Polkujen syöttäminen Mathematicaan on hiukan työlästä: polut on suljettu lainausmerkeissä ja kansioita ei erota viivamerkillä "/", vaan kahdella alaviivalla "\\". Polun kopioiminen Explorerista ei toimi täällä.
Helpoin tapa on käyttää "Lisää" -> "Tiedostorata
"valitse ... "filepath
"valitse ...">
"filepath
"valitse ..." />
"valitse ..." />
ja navigoi täällä tutkimusikkunassa haluamaasi tiedostoon. Mathematica merkitsee sitten tiedostopolun oikein oikeinkirjoituksen kanssa.