티스토리 뷰
728x90
반응형
힐베르트 어쩌고 FFT 돌려야한단다.
유니티에서는 어렵고. 누젯페키지 받아야한단다.
https://www.nuget.org/packages/MathNet.Numerics
MathNet.Numerics 5.0.0
Math.NET Numerics is the numerical foundation of the Math.NET project, aiming to provide methods and algorithms for numerical computations in science, engineering and every day use. Supports .NET 5.0 or higher, .NET Standard 2.0 and .NET Framework 4.6.1 or
www.nuget.org
누젯패키지 파일 확장자를
.zip으로 바꿔서
lib / --2.0 파일에있는
아래의 파일을 복사하여
MathNet.Numerics.dll.meta
유니티 프로젝트 파일 / 에셋 /Plugins 에 붙여넣는다. 이름 중요.
유니티 설정
코드는 GPT 가 알려준다..
using UnityEngine;
using System.Linq;
using MathNet.Numerics;
using MathNet.Numerics.IntegralTransforms;
[RequireComponent(typeof(AudioSource))]
public class H_FFT : MonoBehaviour
{
private AudioSource audioSource;
public int sampleDataLength = 1024;
private float[] sampleData;
void Start()
{
audioSource = GetComponent<AudioSource>();
sampleData = new float[sampleDataLength];
}
void Update()
{
audioSource.GetOutputData(sampleData, 0);
// 힐베르트 변환 수행
Complex32[] complexData = sampleData.Select(x => new Complex32(x, 0)).ToArray();
Fourier.Forward(complexData, FourierOptions.Default);
// 인벨로프 계산
float[] envelope = complexData.Select(x => x.Magnitude).ToArray();
// 여기서 envelope 배열에 인벨로프 값이 저장됩니다.
}
}
728x90
반응형
'Unity' 카테고리의 다른 글
Unity_VR_2024ver_Oculus Quest 3_Meta SDK 패키지 (0) | 2024.08.02 |
---|---|
Unity_real time _ audio thread : audioBuffer (0) | 2023.11.06 |
Unity_ nuget 패키지 추가_dll (0) | 2023.10.12 |
unity _ 아바타 입 모양 내 목소리_ LIPSYNC (0) | 2023.10.10 |
EEG -Emotive EPOC x _ UNITY _ADD훈련 (0) | 2023.09.25 |
250x250
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- motor controll
- opencv
- ardity
- Arduino
- emotive eeg
- DeepLeaning
- colab
- 유니티
- node.js
- sequelize
- unity 360
- 후디니
- Java
- Unity
- Python
- VR
- CNC
- MQTT
- AI
- TouchDesigner
- Express
- oculuspro
- three.js
- Midjourney
- 라즈베리파이
- imgtoimg
- RNN
- 유니티플러그인
- docker
- houdini
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함
반응형