niimpy.preprocessing.audio module

niimpy.preprocessing.audio.audio_count_loud(df_u, config=None)[source]

This function returns the number of times, within the specified timeframe, when there has been some sound louder than 70dB in the environment. If there is no specified timeframe, the function sets a 30 min default time window. The function aggregates this number by user, by timewindow.

Parameters
df_u: pandas.DataFrame

Input data frame

config: dict

Dictionary keys containing optional arguments for the computation of scrren information. Keys can be column names, other dictionaries, etc. The functions needs the column name where the data is stored; if none is given, the default name employed by Aware Framework will be used. To include information about the resampling window, please include the selected parameters from pandas.DataFrame.resample in a dictionary called resample_args.

Returns
result: dataframe

Resulting dataframe

niimpy.preprocessing.audio.audio_count_silent(df_u, config=None)[source]

This function returns the number of times, within the specified timeframe, when there has been some sound in the environment. If there is no specified timeframe, the function sets a 30 min default time window. The function aggregates this number by user, by timewindow.

Parameters
df_u: pandas.DataFrame

Input data frame

config: dict

Dictionary keys containing optional arguments for the computation of screen information. Keys can be column names, other dictionaries, etc. The functions needs the column name where the data is stored; if none is given, the default name employed by Aware Framework will be used. To include information about the resampling window, please include the selected parameters from pandas.DataFrame.resample in a dictionary called resample_args.

Returns
result: dataframe

Resulting dataframe

niimpy.preprocessing.audio.audio_count_speech(df_u, config=None)[source]

This function returns the number of times, within the specified timeframe, when there has been some sound between 65Hz and 255Hz in the environment that could be specified as speech. If there is no specified timeframe, the function sets a 30 min default time window. The function aggregates this number by user, by timewindow.

Parameters
df_u: pandas.DataFrame

Input data frame

config: dict

Dictionary keys containing optional arguments for the computation of scrren information. Keys can be column names, other dictionaries, etc. The functions needs the column name where the data is stored; if none is given, the default name employed by Aware Framework will be used. To include information about the resampling window, please include the selected parameters from pandas.DataFrame.resample in a dictionary called resample_args.

Returns
result: dataframe

Resulting dataframe

niimpy.preprocessing.audio.audio_max_db(df_u, config=None)[source]

This function returns the maximum decibels of the recorded audio snippets, within the specified timeframe. If there is no specified timeframe, the function sets a 30 min default time window. The function aggregates this number by user, by timewindow.

Parameters
df_u: pandas.DataFrame

Input data frame

config: dict

Dictionary keys containing optional arguments for the computation of scrren information. Keys can be column names, other dictionaries, etc. The functions needs the column name where the data is stored; if none is given, the default name employed by Aware Framework will be used. To include information about the resampling window, please include the selected parameters from pandas.DataFrame.resample in a dictionary called resample_args.

Returns
result: dataframe

Resulting dataframe

niimpy.preprocessing.audio.audio_max_freq(df_u, config=None)[source]

This function returns the maximum frequency of the recorded audio snippets, within the specified timeframe. If there is no specified timeframe, the function sets a 30 min default time window. The function aggregates this number by user, by timewindow.

Parameters
df_u: pandas.DataFrame

Input data frame

config: dict

Dictionary keys containing optional arguments for the computation of scrren information. Keys can be column names, other dictionaries, etc. The functions needs the column name where the data is stored; if none is given, the default name employed by Aware Framework will be used. To include information about the resampling window, please include the selected parameters from pandas.DataFrame.resample in a dictionary called resample_args.

Returns
result: dataframe

Resulting dataframe

niimpy.preprocessing.audio.audio_mean_db(df_u, config=None)[source]

This function returns the mean decibels of the recorded audio snippets, within the specified timeframe. If there is no specified timeframe, the function sets a 30 min default time window. The function aggregates this number by user, by timewindow.

Parameters
df_u: pandas.DataFrame

Input data frame

config: dict

Dictionary keys containing optional arguments for the computation of scrren information. Keys can be column names, other dictionaries, etc. The functions needs the column name where the data is stored; if none is given, the default name employed by Aware Framework will be used. To include information about the resampling window, please include the selected parameters from pandas.DataFrame.resample in a dictionary called resample_args.

Returns
result: dataframe

Resulting dataframe

niimpy.preprocessing.audio.audio_mean_freq(df_u, config=None)[source]

This function returns the mean frequency of the recorded audio snippets, within the specified timeframe. If there is no specified timeframe, the function sets a 30 min default time window. The function aggregates this number by user, by timewindow.

Parameters
df_u: pandas.DataFrame

Input data frame

config: dict

Dictionary keys containing optional arguments for the computation of scrren information. Keys can be column names, other dictionaries, etc. The functions needs the column name where the data is stored; if none is given, the default name employed by Aware Framework will be used. To include information about the resampling window, please include the selected parameters from pandas.DataFrame.resample in a dictionary called resample_args.

Returns
result: dataframe

Resulting dataframe

niimpy.preprocessing.audio.audio_median_db(df_u, config)[source]

This function returns the median decibels of the recorded audio snippets, within the specified timeframe. If there is no specified timeframe, the function sets a 30 min default time window. The function aggregates this number by user, by timewindow.

Parameters
df_u: pandas.DataFrame

Input data frame

config: dict

Dictionary keys containing optional arguments for the computation of scrren information. Keys can be column names, other dictionaries, etc. The functions needs the column name where the data is stored; if none is given, the default name employed by Aware Framework will be used. To include information about the resampling window, please include the selected parameters from pandas.DataFrame.resample in a dictionary called resample_args.

Returns
result: dataframe

Resulting dataframe

niimpy.preprocessing.audio.audio_median_freq(df_u, config=None)[source]

This function returns the median frequency of the recorded audio snippets, within the specified timeframe. If there is no specified timeframe, the function sets a 30 min default time window. The function aggregates this number by user, by timewindow.

Parameters
df_u: pandas.DataFrame

Input data frame

config: dict

Dictionary keys containing optional arguments for the computation of scrren information. Keys can be column names, other dictionaries, etc. The functions needs the column name where the data is stored; if none is given, the default name employed by Aware Framework will be used. To include information about the resampling window, please include the selected parameters from pandas.DataFrame.resample in a dictionary called resample_args.

Returns
result: dataframe

Resulting dataframe

niimpy.preprocessing.audio.audio_min_db(df_u, config=None)[source]

This function returns the minimum decibels of the recorded audio snippets, within the specified timeframe. If there is no specified timeframe, the function sets a 30 min default time window. The function aggregates this number by user, by timewindow.

Parameters
df_u: pandas.DataFrame

Input data frame

config: dict

Dictionary keys containing optional arguments for the computation of scrren information. Keys can be column names, other dictionaries, etc. The functions needs the column name where the data is stored; if none is given, the default name employed by Aware Framework will be used. To include information about the resampling window, please include the selected parameters from pandas.DataFrame.resample in a dictionary called resample_args.

Returns
result: dataframe

Resulting dataframe

niimpy.preprocessing.audio.audio_min_freq(df_u, config=None)[source]

This function returns the minimum frequency of the recorded audio snippets, within the specified timeframe. If there is no specified timeframe, the function sets a 30 min default time window. The function aggregates this number by user, by timewindow.

Parameters
df_u: pandas.DataFrame

Input data frame

config: dict

Dictionary keys containing optional arguments for the computation of scrren information. Keys can be column names, other dictionaries, etc. The functions needs the column name where the data is stored; if none is given, the default name employed by Aware Framework will be used. To include information about the resampling window, please include the selected parameters from pandas.DataFrame.resample in a dictionary called resample_args.

Returns
result: dataframe

Resulting dataframe

niimpy.preprocessing.audio.audio_std_db(df_u, config=None)[source]

This function returns the standard deviation of the decibels of the recorded audio snippets, within the specified timeframe. If there is no specified timeframe, the function sets a 30 min default time window. The function aggregates this number by user, by timewindow.

Parameters
df_u: pandas.DataFrame

Input data frame

config: dict

Dictionary keys containing optional arguments for the computation of scrren information. Keys can be column names, other dictionaries, etc. The functions needs the column name where the data is stored; if none is given, the default name employed by Aware Framework will be used. To include information about the resampling window, please include the selected parameters from pandas.DataFrame.resample in a dictionary called resample_args.

Returns
result: dataframe

Resulting dataframe

niimpy.preprocessing.audio.audio_std_freq(df_u, config=None)[source]

This function returns the standard deviation of the frequency of the recorded audio snippets, within the specified timeframe. If there is no specified timeframe, the function sets a 30 min default time window. The function aggregates this number by user, by timewindow.

Parameters
df_u: pandas.DataFrame

Input data frame

config: dict

Dictionary keys containing optional arguments for the computation of scrren information. Keys can be column names, other dictionaries, etc. The functions needs the column name where the data is stored; if none is given, the default name employed by Aware Framework will be used. To include information about the resampling window, please include the selected parameters from pandas.DataFrame.resample in a dictionary called resample_args.

Returns
result: dataframe

Resulting dataframe

niimpy.preprocessing.audio.extract_features_audio(df, features=None)[source]

This function computes and organizes the selected features for audio snippets that have been recorded using Aware Framework. The function aggregates the features by user, by time window. If no time window is specified, it will automatically aggregate the features in 30 mins non-overlapping windows.

The complete list of features that can be calculated are: audio_count_silent, audio_count_speech, audio_count_loud, audio_min_freq, audio_max_freq, audio_mean_freq, audio_median_freq, audio_std_freq, audio_min_db, audio_max_db, audio_mean_db, audio_median_db, audio_std_db

Parameters
df: pandas.DataFrame

Input data frame

features: dict, optional

Dictionary keys contain the names of the features to compute. If none is given, all features will be computed.

Returns
result: dataframe

Resulting dataframe

niimpy.preprocessing.audio.group_data(df)[source]

Group the dataframe by a standard set of columns listed in group_by_columns.

niimpy.preprocessing.audio.reset_groups(df)[source]

Group the dataframe by a standard set of columns listed in group_by_columns.