Hey everyone ,my question is that after extraction of features from signal , how we change these to vector and make a class. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Hey everyone ,my question is that after extraction of features from signal , how we change these to vector and make a class.

I've processed a speech based files and extracted spectrogram/pitch/DFT/MFCC . I wants to classify with rates which is numerical values file. Is there any method/procedure to convert a spectrogram or mention data to vectors in python . Thanks a lot for responding in advance .

23rd Mar 2023, 6:31 PM
Muhammad Faisal
Muhammad Faisal - avatar
6 Answers
+ 2
Your description is way too general. A "numerical values file" is meaningless. Of course there are tools in Python that allow you to process data, and read it from the file system into memory, in a structured format. Numpy and Pandas libraries are typically used for data analysis and data engineering. For example you can use pandas.read_csv function to import a CSV file to a pandas DataFrame. https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html If you provide more detail, give examples, or even attach your code, maybe we can suggest solutions that are more specific to your problem.
24th Mar 2023, 5:08 AM
Tibor Santa
Tibor Santa - avatar
+ 2
Yes, you can convert the extracted features to feature vectors in Python. One common way to do this is to concatenate the extracted features into a single feature vector. For example, if you have extracted the MFCC features, pitch and spectrogram from an audio file, you could concatenate these features into a single feature vector using the `numpy` library: ``` import numpy as np # assume mfcc, pitch and spec are already extracted features mfcc_feature_vector = np.concatenate(mfcc, axis=0) pitch_feature_vector = np.concatenate(pitch, axis=0) spec_feature_vector = np.concatenate(spec, axis=0) # concatenate all the feature vectors into a single feature vector feature_vector = np.concatenate((mfcc_feature_vector, pitch_feature_vector, spec_feature_vector)) ``` Once you have created the feature vector for a given audio file, you can use it to train a classifier using any machine learning algorithm such as Support Vector Machines (SVM), Random Forest, etc. To create a class, you can store the
25th Mar 2023, 6:57 AM
Otid Kartgepsut
Otid Kartgepsut - avatar
+ 1
What specifically are the tools you used to obtain your spectrogram (the python modules you used and the data you extracted)?
24th Mar 2023, 12:44 PM
Bob_Li
Bob_Li - avatar
+ 1
if you are already extracted the data, it would imply that the data are already in a numerical array or at least in a standard structured format. Converting those to csv should be doable. Or perhaps you could get the csv output higher up the pipeline? Hard to say anything without knowing the details of your actual setup. maybe some library you are using to preprocess the data could produce the csv you need. It eould be inefficient and probably be lossy to do it in multiple passes if you could do it in one. So without more concrete detail, it is hard to suggest a tool or workflow. This YouTube video looked helpful https://m.youtube.com/watch?v=vbhlEMcb7RQ
24th Mar 2023, 2:18 PM
Bob_Li
Bob_Li - avatar
0
I've Spectrogram that's graphical form we need to make it comma separated vectors . My question was about making csv from graphs/visual and then classified for further use .
24th Mar 2023, 7:10 AM
Muhammad Faisal
Muhammad Faisal - avatar
0
I'm using Google colab editor with built-in libraries pyplot, librosa and some others. I've extracted the spectrogram , log, DFT, tempogram and other time/frequency domain features.
24th Mar 2023, 1:12 PM
Muhammad Faisal
Muhammad Faisal - avatar