Subject: Re: Octave code request ... was : Matlab code request From: Matt Flax <flatmax(at)MATT.FLAX> Date: Tue, 28 Sep 2004 01:49:07 +1000OK, I see ... well we can write a function to help you to generate the noise and then generate the tone ... I guess you will do something like so in octave (GPL math script language ... check www.octave.org) I will assume that you want tone in notched out noise here ??? If not let me know.... you will have to find someone to fill in the various sections ... I am only creating a specification for you ... with some hints ... save the following to a file and run octave from that directory. ========== BEGIN toneInNotchedNoise.m ================= function signal=toneInNotchedNoise(noiseAmp, notchCF, notchBW, signalDuration, toneF, toneAmp, fs) %# toneInNotchedNoise is an octave function to generate arbitrary tone %# in Notched noise type signals for psychological experiments. %# input: %# noiseAmp : level of the noise %# notchCF : centre frequency of the notch filter (Hz) %# notchBW : 3dB bandwidth of the notch %# signalDuration : seconds %# toneF : Frequency of the tone (Hz) %# toneAmp : Amplitude of the tone %# fs : Sample freq. (Hz) %# output : %# signal : tone in notched noise %# changelog %# v1 : Specification by flatmax under GPL license [1] %# Generate noise here signal=rand(1,duration*fs); %# Notch filter noise here ... %# i] gen filter [b,a]=butter.... %# ii] filter noise signal=filter(b,a,signal); %# generate tone and sum to notched noise signal+=sin(....) %#[1] %# toneInNotchedNoise is an octave function to generate arbitrary tone %# in Notched noise type signals for psychological experiments. %# Copyright (C) 2004 Auditory mail list %# This program is free software; you can redistribute it and/or %# modify it under the terms of the GNU General Public License %# as published by the Free Software Foundation; either version 2 %# of the License, or (at your option) any later version. %# This program is distributed in the hope that it will be useful, %# but WITHOUT ANY WARRANTY; without even the implied warranty of %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %# GNU General Public License for more details. %# You should have received a copy of the GNU General Public License %# along with this program; if not, write to the Free Software %# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA %# 02111-1307, USA. endfunction =========== END toneInNotchedNoise.m ============== On Mon, Sep 27, 2004 at 10:52:57AM -0400, Amanda Lauer wrote: > I'm actually not sure exactly what I want to test my subjects on. I > need to write a program that generates loads of different noise/tone > combinations at different signal-to-noise ratios. Unfortunately, I am > not very experienced with Matlab. > > Amanda Lauer > Dept. of Psychology > Center for the Comparative & > Evolutionary Biology of Hearing > University of Maryland > College Park, MD 20783 > 301-405-5940 > > >>> flatmax(at)Matt.Flax 9/27/2004 10:44:17 AM >>> > Hi, > > I can generate such signals for you, however I require specifications. > > Matt > > On Mon, Sep 27, 2004 at 10:27:21AM -0400, Amanda Lauer wrote: > > Does anyone have Matlab code for generating stimuli for measuring > > psychophysical tuning curves and/or forward masking that I may have > a > > look at? In particular, stimuli with a narrowband noise masker would > be > > useful. Thanks in advance. > > > > Amanda Lauer > > Dept. of Psychology > > Center for the Comparative & > > Evolutionary Biology of Hearing > > University of Maryland > > College Park, MD 20783 > > 301-405-5940 > > > BEGIN:VCARD > > VERSION:2.1 > > X-GWTYPE:USER > > FN:Lauer, Amanda > > TEL;WORK:0 > > ORG:;PSYC > > TEL;PREF;FAX:314-9566 > > EMAIL;WORK;PREF;NGW:alauer(at)psyc.umd.edu > > N:Lauer;Amanda > > TITLE:Graduate Student > > ADR;DOM;WORK;PARCEL;POSTAL:;0 Bio-Psyc > > LABEL;DOM;WORK;PARCEL;POSTAL;ENCODING=QUOTED-PRINTABLE:Lauer, > Amanda=0A= > > 0 Bio-Psyc > > END:VCARD > > > > > -- > http://www.flatmax.org > > WSOLA TimeScale Audio Mod : http://mffmtimescale.sourceforge.net/ > FFTw C++ : http://mffmfftwrapper.sourceforge.net/ > Vector Bass : http://mffmvectorbass.sourceforge.net/ > Multimedia Time Code : http://mffmtimecode.sourceforge.net/ > BEGIN:VCARD > VERSION:2.1 > X-GWTYPE:USER > FN:Lauer, Amanda > TEL;WORK:0 > ORG:;PSYC > TEL;PREF;FAX:314-9566 > EMAIL;WORK;PREF;NGW:alauer(at)psyc.umd.edu > N:Lauer;Amanda > TITLE:Graduate Student > ADR;DOM;WORK;PARCEL;POSTAL:;0 Bio-Psyc > LABEL;DOM;WORK;PARCEL;POSTAL;ENCODING=QUOTED-PRINTABLE:Lauer, Amanda=0A= > 0 Bio-Psyc > END:VCARD > -- http://www.flatmax.org WSOLA TimeScale Audio Mod : http://mffmtimescale.sourceforge.net/ FFTw C++ : http://mffmfftwrapper.sourceforge.net/ Vector Bass : http://mffmvectorbass.sourceforge.net/ Multimedia Time Code : http://mffmtimecode.sourceforge.net/